:root {
  --paper: #f5efe2;
  --surface: #fffaf0;
  --surface-strong: #ffffff;
  --ink: #17202c;
  --muted: #6a5f54;
  --line: #dfd0bd;
  --cinnabar: #b9402b;
  --cinnabar-dark: #862c20;
  --star-blue: #143a58;
  --jade: #2d8b7f;
  --gold: #d69b3a;
  --danger: #b3261e;
  --code: #111a24;
  --radius: 8px;
  font-family:
    "Segoe UI",
    "Microsoft YaHei",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  color: var(--ink);
  background:
    linear-gradient(180deg, #12263b 0 360px, transparent 360px),
    repeating-linear-gradient(90deg, rgb(185 64 43 / 0.05) 0 1px, transparent 1px 84px),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 42px;
}

.site-header {
  position: sticky;
  top: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  margin-bottom: 16px;
  border: 1px solid rgb(255 255 255 / 0.22);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: #fff7e8;
  background: rgb(18 38 59 / 0.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgb(7 18 31 / 0.22);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  text-decoration: none;
}

.brand-sigil {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgb(214 155 58 / 0.72);
  border-radius: 50%;
  color: #ffe4a8;
  background: rgb(214 155 58 / 0.13);
  font-size: 1.12rem;
  font-weight: 900;
}

.brand-mark strong,
.brand-mark small {
  display: block;
}

.brand-mark strong {
  font-size: 1.02rem;
  letter-spacing: 0.04em;
}

.brand-mark small {
  margin-top: 2px;
  color: #dacdbd;
  font-size: 0.78rem;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  border-radius: 999px;
  padding: 9px 12px;
  color: #f9ecda;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  outline: 0;
  background: rgb(255 255 255 / 0.13);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
}

.hero,
.heritage-panel,
.ai-panel,
.mission-gallery {
  grid-column: 1 / -1;
}

.hero {
  position: relative;
  min-height: min(680px, calc(100dvh - 108px));
  overflow: hidden;
  border-radius: var(--radius);
  background: #0d1722;
  box-shadow: 0 28px 80px rgb(8 19 31 / 0.28);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img,
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05) contrast(1.04);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgb(11 20 31 / 0.88) 0%, rgb(11 20 31 / 0.68) 42%, rgb(11 20 31 / 0.20) 72%),
    linear-gradient(0deg, rgb(11 20 31 / 0.70), transparent 48%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(780px, 100%);
  min-height: inherit;
  padding: clamp(32px, 7vw, 88px);
  color: #fff4dc;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cinnabar);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.hero .eyebrow {
  color: #ffc06c;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-copy h1 {
  max-width: 12ch;
  margin-bottom: 18px;
  font-size: clamp(2.9rem, 7vw, 6.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.04rem;
}

.lead {
  width: min(660px, 100%);
  margin-bottom: 22px;
  color: #f0dfc5;
  font-size: clamp(1rem, 1.8vw, 1.24rem);
  line-height: 1.78;
}

.hero-actions,
.button-row,
.team-toolbar,
.example-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-link,
.secondary-link,
.primary-button,
.ghost-button,
.danger-button,
.file-button,
.example-button,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-weight: 900;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-link,
.primary-button {
  color: #fffaf1;
  background: var(--cinnabar);
  box-shadow: 0 12px 30px rgb(185 64 43 / 0.25);
}

.primary-link:hover,
.primary-button:hover {
  background: var(--cinnabar-dark);
}

.secondary-link,
.ghost-button,
.ghost-link,
.file-button,
.example-button {
  border: 1px solid var(--line);
  color: var(--star-blue);
  background: rgb(255 250 240 / 0.88);
}

.hero .secondary-link {
  border-color: rgb(255 244 220 / 0.34);
  color: #fff4dc;
  background: rgb(255 244 220 / 0.12);
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.primary-link:active,
.secondary-link:active,
.primary-button:active,
.ghost-button:active,
.danger-button:active,
.file-button:active,
.example-button:active {
  transform: translateY(1px);
}

.team-gateway {
  position: absolute;
  right: clamp(18px, 4vw, 48px);
  bottom: clamp(18px, 4vw, 48px);
  z-index: 1;
  width: min(360px, calc(100% - 36px));
  border: 1px solid rgb(255 244 220 / 0.28);
  border-radius: var(--radius);
  padding: 16px;
  color: #fff4dc;
  background: rgb(12 26 40 / 0.68);
  backdrop-filter: blur(18px);
}

.spike-stage {
  position: absolute;
  right: clamp(18px, 4vw, 56px);
  top: clamp(88px, 13vw, 150px);
  z-index: 1;
  width: min(430px, 32vw);
  min-width: 310px;
  height: 294px;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgb(255 192 108 / 0.28);
  border-radius: var(--radius);
  background: #142532;
  box-shadow:
    0 30px 70px rgb(0 0 0 / 0.36),
    inset 0 0 0 1px rgb(255 255 255 / 0.10);
  transform: rotate(2deg);
}

.spike-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: sepia(0.54) hue-rotate(340deg) saturate(0.94) contrast(1.12) brightness(0.68);
  transform: scale(1.08);
}

.spike-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(7 20 31 / 0.16), rgb(7 20 31 / 0.92)),
    linear-gradient(90deg, rgb(178 76 45 / 0.34), transparent 62%);
  pointer-events: none;
}

.spike-stage figcaption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  color: #fff4dc;
}

.spike-stage figcaption span {
  color: #ffc06c;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.spike-stage figcaption strong {
  font-size: 1.25rem;
}

.team-gateway span {
  display: block;
  margin-bottom: 6px;
  color: #ffc06c;
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.team-gateway strong {
  display: block;
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.team-grid button {
  border: 1px solid rgb(255 244 220 / 0.24);
  border-radius: var(--radius);
  padding: 9px 8px;
  color: #fff4dc;
  background: rgb(255 244 220 / 0.10);
  font-size: 0.86rem;
  font-weight: 900;
}

.mission-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) minmax(280px, 0.55fr);
  gap: 12px;
}

.mission-tile {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-radius: var(--radius);
  color: #fff7e8;
  background: var(--star-blue);
}

.mission-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mission-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgb(9 20 31 / 0.82), rgb(9 20 31 / 0.12) 62%);
}

.mission-tile div {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  padding: 18px;
}

.mission-tile span {
  display: inline-flex;
  margin-bottom: 8px;
  border: 1px solid rgb(255 192 108 / 0.45);
  border-radius: 999px;
  padding: 4px 8px;
  color: #ffc06c;
  font-size: 0.76rem;
  font-weight: 950;
}

.mission-tile h2 {
  max-width: 13ch;
  margin-bottom: 8px;
  font-size: clamp(1.5rem, 2.8vw, 2.6rem);
}

.mission-tile p {
  margin-bottom: 0;
  color: #f0dfc5;
  line-height: 1.65;
}

.mission-script {
  background:
    linear-gradient(135deg, rgb(185 64 43 / 0.92), rgb(20 58 88 / 0.94)),
    var(--star-blue);
}

.mission-script::before {
  content: "AI";
  position: absolute;
  top: 18px;
  right: 18px;
  color: rgb(255 255 255 / 0.18);
  font-size: 5rem;
  font-weight: 950;
  line-height: 1;
}

.mission-script::after {
  display: none;
}

.mission-script div {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 300px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 2.6vw, 28px);
  background: rgb(255 250 240 / 0.94);
  box-shadow: 0 14px 36px rgb(67 43 26 / 0.08);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.panel-note {
  max-width: 84ch;
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.72;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--star-blue);
  background: #fff;
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill[data-state="ok"] {
  color: #0f6b4f;
  border-color: rgb(45 139 127 / 0.35);
  background: rgb(45 139 127 / 0.10);
}

.status-pill[data-state="error"] {
  color: var(--danger);
  border-color: rgb(179 38 30 / 0.30);
  background: rgb(179 38 30 / 0.10);
}

.heritage-panel {
  background:
    linear-gradient(90deg, rgb(20 58 88 / 0.08), transparent 55%),
    linear-gradient(180deg, #fffaf0, #fff6ea);
}

.heritage-summary {
  display: inline-flex;
  width: fit-content;
  margin: 4px 0 16px;
  border: 1px solid rgb(214 155 58 / 0.34);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: #70461a;
  background: rgb(214 155 58 / 0.12);
  font-weight: 900;
}

.heritage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.heritage-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #eadcc9;
  border-radius: var(--radius);
  background: #fffdf9;
}

.heritage-media {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 126px;
  overflow: hidden;
  background: var(--star-blue);
}

.heritage-media img {
  width: 100%;
  height: 126px;
  object-fit: cover;
}

.heritage-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  color: #d9e9ee;
  font-weight: 900;
}

.heritage-card-body {
  padding: 12px;
}

.heritage-type {
  display: inline-flex;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 4px 8px;
  color: #0f4f4a;
  background: rgb(45 139 127 / 0.12);
  font-size: 0.78rem;
  font-weight: 950;
}

.heritage-card h3 {
  min-height: 2.7em;
  line-height: 1.35;
}

.heritage-card p,
.heritage-warning {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.heritage-card a {
  color: var(--cinnabar-dark);
  font-weight: 950;
  text-decoration: none;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field,
.prompt-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.field input,
.field select,
.prompt-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  color: var(--ink);
  background: #fffdf8;
  outline: none;
}

.field input:focus,
.field select:focus,
.prompt-field textarea:focus {
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgb(45 139 127 / 0.18);
}

.prompt-field textarea {
  min-height: 148px;
  resize: vertical;
  line-height: 1.6;
}

.section-title {
  margin: 20px 0 10px;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.port-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.port-card,
.member-card,
.drive-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fffdf8;
}

.port-card {
  display: grid;
  gap: 10px;
}

.port-title,
.member-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 950;
}

.port-title span:first-child {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  background: var(--star-blue);
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.drive-card .field-grid {
  margin-top: 12px;
}

.member-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.member-card {
  text-align: left;
}

.member-card.active {
  border-color: rgb(185 64 43 / 0.62);
  box-shadow: inset 0 0 0 2px rgb(185 64 43 / 0.12);
}

.member-card {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}

.member-index {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fffaf1;
  background: var(--cinnabar);
  font-weight: 950;
}

.member-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.member-card small,
.member-card p {
  color: var(--muted);
  line-height: 1.45;
}

.hub-output-wrap {
  margin-top: 14px;
}

.hub-output,
.code-box {
  overflow: auto;
  margin: 0;
  border-radius: var(--radius);
  padding: 13px;
  color: #e8f4f8;
  background: var(--code);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.88rem;
  line-height: 1.52;
}

.hub-output {
  min-height: 142px;
  max-height: 240px;
  white-space: pre-wrap;
}

.sensor-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sensor-strip span {
  border: 1px solid rgb(45 139 127 / 0.28);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: #0f4f4a;
  background: rgb(45 139 127 / 0.10);
  font-weight: 900;
}

.ai-panel {
  background:
    linear-gradient(90deg, rgb(185 64 43 / 0.08), transparent 42%),
    #fffaf0;
}

.example-row {
  margin: 12px 0 14px;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 16px;
  margin-top: 18px;
}

.result-card {
  min-width: 0;
  border-top: 2px solid var(--line);
  padding-top: 14px;
}

.action-card {
  grid-column: 1 / -1;
}

.plan-output {
  color: var(--muted);
  line-height: 1.65;
}

.plan-output ul,
.plan-output ol {
  padding-left: 20px;
}

.plan-output strong {
  color: var(--ink);
}

.code-note {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.code-box {
  min-height: 440px;
  max-height: 680px;
  white-space: pre;
}

.code-box.compact {
  min-height: 156px;
  max-height: 260px;
  white-space: pre-wrap;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 1180px) {
  .workspace,
  .result-layout,
  .field-grid,
  .mission-gallery {
    grid-template-columns: 1fr;
  }

  .heritage-grid,
  .member-list,
  .port-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 1480px);
    padding-top: 10px;
  }

  .site-header,
  .panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-mark {
    min-width: 0;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero {
    min-height: 720px;
  }

  .hero-copy {
    justify-content: flex-start;
    padding: 28px 22px;
  }

  .hero-copy h1 {
    max-width: 10ch;
  }

  .team-gateway {
    right: 16px;
    bottom: 16px;
  }

  .spike-stage {
    display: none;
  }

  .team-grid,
  .heritage-grid,
  .member-list,
  .port-grid {
    grid-template-columns: 1fr;
  }

  .primary-link,
  .secondary-link,
  .primary-button,
  .ghost-button,
  .danger-button,
  .file-button,
  .example-button,
  .ghost-link {
    width: 100%;
  }
}

/* Student experience: a public, child-friendly layer that never exposes robot code. */
.student-experience {
  grid-column: 1 / -1;
  display: grid;
  gap: 22px;
}

.teacher-console {
  display: none;
}

.teacher-entry {
  display: none;
}

.teacher-task-list {
  display: grid;
  gap: 10px;
}

.teacher-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fffdf8;
}

.teacher-task-item span {
  color: var(--cinnabar);
  font-size: 0.76rem;
  font-weight: 900;
}

.teacher-task-item h3 {
  margin: 3px 0 5px;
}

.teacher-task-item p,
.teacher-task-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.teacher-task-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px;
}

body.teacher-mode .student-experience {
  display: none;
}

body.teacher-mode .teacher-console {
  display: contents;
}

body.teacher-mode .site-nav a:not(.teacher-entry) {
  display: none;
}

body.teacher-mode .teacher-entry {
  display: inline-flex;
  color: #fff4dc;
  background: rgb(255 244 220 / 0.14);
}

.student-hero {
  position: relative;
  isolation: isolate;
  min-height: min(720px, calc(100dvh - 104px));
  overflow: hidden;
  border: 1px solid rgb(255 236 191 / 0.26);
  border-radius: var(--radius);
  color: #fff6e8;
  background: #0b2131;
  box-shadow: 0 28px 76px rgb(7 18 31 / 0.28);
}

.student-hero-media,
.student-hero-media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.student-hero-media video {
  object-fit: cover;
  filter: saturate(0.9) contrast(1.1) brightness(0.72);
}

.student-hero::before,
.student-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.student-hero::before {
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(5 22 35 / 0.92) 0%, rgb(5 22 35 / 0.73) 48%, rgb(5 22 35 / 0.22) 74%),
    linear-gradient(0deg, rgb(5 22 35 / 0.82), transparent 46%);
}

.student-hero::after {
  z-index: 1;
  background-image: radial-gradient(circle at 15% 18%, rgb(255 227 166 / 0.72) 0 1px, transparent 1.6px);
  background-size: 76px 76px;
  opacity: 0.44;
}

.student-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(660px, 58%);
  min-height: inherit;
  padding: clamp(32px, 7vw, 96px);
}

.student-kicker {
  margin: 0 0 10px;
  color: #ffc56b;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.student-hero h1 {
  max-width: 9ch;
  margin-bottom: 18px;
  font-size: clamp(3.1rem, 7vw, 6.4rem);
  line-height: 0.98;
}

.student-hero-copy > p:not(.student-kicker) {
  max-width: 28em;
  margin-bottom: 26px;
  color: #f6e4c9;
  font-size: clamp(1.03rem, 1.8vw, 1.25rem);
  line-height: 1.8;
}

.student-hero-actions,
.robot-intent-row,
.question-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.student-primary,
.student-secondary,
.student-text-button,
.voice-button,
.robot-intent-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 15px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.student-primary {
  color: #fff9ee;
  background: var(--cinnabar);
  box-shadow: 0 12px 30px rgb(185 64 43 / 0.28);
}

.student-primary:hover {
  background: var(--cinnabar-dark);
}

.student-secondary,
.student-text-button {
  border-color: rgb(255 236 191 / 0.36);
  color: #fff6e8;
  background: rgb(9 39 55 / 0.54);
}

.student-text-button {
  min-height: 36px;
  color: var(--star-blue);
  background: transparent;
  border-color: var(--line);
}

.student-primary:active,
.student-secondary:active,
.student-text-button:active,
.voice-button:active,
.robot-intent-row button:active {
  transform: translateY(1px);
}

.guide-portrait {
  position: absolute;
  right: clamp(32px, 6vw, 100px);
  top: clamp(62px, 10vw, 104px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: min(420px, 34vw);
  min-width: 310px;
  aspect-ratio: 1;
}

.guide-portrait::before {
  content: "";
  position: absolute;
  inset: 7%;
  border: 1px solid rgb(255 200 108 / 0.36);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(16 57 72 / 0.76), rgb(10 28 44 / 0.12) 66%, transparent 67%);
}

.guide-portrait img {
  position: relative;
  z-index: 2;
  width: 78%;
  height: 78%;
  border: 1px solid rgb(255 228 173 / 0.34);
  border-radius: 50%;
  object-fit: cover;
  filter: sepia(0.48) hue-rotate(336deg) saturate(0.96) contrast(1.1) brightness(0.72);
  box-shadow: 0 26px 60px rgb(0 0 0 / 0.34);
}

.guide-portrait-copy {
  position: absolute;
  z-index: 3;
  right: -6%;
  bottom: 10%;
  width: min(230px, 58%);
  border: 1px solid rgb(255 236 191 / 0.28);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgb(6 28 42 / 0.76);
  backdrop-filter: blur(14px);
}

.guide-portrait-copy span,
.guide-portrait-copy strong,
.guide-portrait-copy p {
  display: block;
}

.guide-portrait-copy span {
  color: #ffc56b;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.guide-portrait-copy strong {
  margin: 2px 0 4px;
  font-size: 1.28rem;
}

.guide-portrait-copy p {
  margin: 0;
  color: #e8d8bc;
  font-size: 0.82rem;
  line-height: 1.45;
}

.guide-orbit {
  position: absolute;
  z-index: 1;
  border: 1px dashed rgb(255 200 108 / 0.52);
  border-radius: 50%;
}

.orbit-one {
  inset: 0;
  animation: orbit-turn 22s linear infinite;
}

.orbit-two {
  inset: 15%;
  border-color: rgb(90 194 184 / 0.62);
  animation: orbit-turn 15s linear infinite reverse;
}

@keyframes orbit-turn {
  to { transform: rotate(360deg); }
}

.student-session-strip {
  position: absolute;
  z-index: 3;
  left: clamp(24px, 4vw, 64px);
  bottom: clamp(20px, 4vw, 44px);
  max-width: min(490px, calc(100% - 44px));
  border-left: 3px solid #ffc56b;
  padding: 9px 12px;
  background: rgb(5 22 35 / 0.66);
}

.hero-motion-toggle {
  position: absolute;
  z-index: 4;
  right: clamp(18px, 3vw, 42px);
  bottom: clamp(18px, 3vw, 34px);
  min-height: 34px;
  border: 1px solid rgb(255 236 191 / 0.34);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: #fff6e8;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgb(5 22 35 / 0.62);
  backdrop-filter: blur(10px);
}

.hero-motion-toggle:hover,
.hero-motion-toggle:focus-visible {
  outline: 0;
  border-color: #ffc56b;
  background: rgb(5 22 35 / 0.86);
}

.student-session-strip span,
.student-session-strip strong {
  display: block;
}

.student-session-strip span {
  color: #ffc56b;
  font-size: 0.72rem;
  font-weight: 900;
}

.student-session-strip strong {
  margin-top: 2px;
  font-size: 0.94rem;
}

/* Each public team page is a safe, structured AI-generated layer over the shared platform. */
.team-showcase {
  --team-accent: #d69b3a;
  --team-ink: #fff8e9;
  position: relative;
  isolation: isolate;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgb(255 236 191 / 0.28);
  border-radius: var(--radius);
  color: var(--team-ink);
  background: #102d3b;
  box-shadow: 0 24px 64px rgb(7 18 31 / 0.2);
}

.team-showcase-media,
.team-showcase-media::after,
.team-showcase-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.team-showcase-media {
  z-index: -2;
  background: #153b4b;
}

.team-showcase-media img {
  object-fit: cover;
  filter: saturate(0.75) contrast(1.12) brightness(0.42);
  transform: scale(1.02);
}

.team-showcase-media::after {
  content: "";
  z-index: 1;
  background:
    linear-gradient(90deg, rgb(5 24 36 / 0.96), rgb(8 31 41 / 0.74) 52%, rgb(7 26 35 / 0.48)),
    linear-gradient(0deg, rgb(5 22 35 / 0.9), transparent 58%);
}

.team-showcase-overlay {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 22px;
  min-height: 620px;
  padding: clamp(28px, 5vw, 68px);
}

.team-showcase-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 22px;
}

.team-showcase-head h2 {
  max-width: 15ch;
  margin: 0 0 12px;
  color: #fff8e9;
  font-size: clamp(2.2rem, 5vw, 5.2rem);
  line-height: 0.98;
}

.team-showcase-tagline {
  max-width: 42em;
  margin: 0;
  color: #f5e4c9;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.7;
}

.team-showcase-status {
  flex: 0 0 auto;
  border: 1px solid rgb(255 236 191 / 0.44);
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff1c8;
  font-size: 0.75rem;
  font-weight: 900;
  background: rgb(5 27 40 / 0.54);
}

.team-showcase-meta {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.6fr);
  gap: 20px;
  align-items: end;
}

.team-showcase-meta > p {
  max-width: 52em;
  margin: 0;
  color: #dbe7df;
  line-height: 1.7;
}

.team-showcase-focus {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 7px;
}

.team-showcase-focus span {
  border-left: 2px solid var(--team-accent);
  padding: 4px 0 4px 8px;
  color: #fff0cd;
  font-size: 0.76rem;
  font-weight: 900;
}

.team-showcase-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(250px, 0.76fr);
  gap: 12px;
}

.team-research-thread,
.team-robot-bridge {
  min-width: 0;
  border: 1px solid rgb(255 236 191 / 0.22);
  border-radius: 5px;
  padding: clamp(16px, 2.6vw, 25px);
  background: rgb(3 27 39 / 0.6);
  backdrop-filter: blur(12px);
}

.team-showcase-label,
.team-studio-label {
  display: block;
  color: #81dbc3;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.team-research-thread h3,
.team-robot-bridge h3 {
  margin: 5px 0 16px;
  color: #fff6df;
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  line-height: 1.28;
}

.team-showcase-chapters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.team-showcase-chapter {
  min-height: 150px;
  border-top: 2px solid var(--team-accent);
  padding: 11px 9px 8px;
  background: rgb(255 255 255 / 0.06);
}

.team-showcase-chapter span,
.team-showcase-chapter strong,
.team-showcase-chapter p {
  display: block;
}

.team-showcase-chapter span {
  color: #ffc56b;
  font-size: 0.65rem;
  font-weight: 900;
}

.team-showcase-chapter strong {
  margin: 5px 0 7px;
  color: #fff6df;
  font-size: 0.9rem;
}

.team-showcase-chapter p {
  margin: 0;
  color: #d2e0d8;
  font-size: 0.79rem;
  line-height: 1.55;
}

.team-robot-bridge {
  border-color: color-mix(in srgb, var(--team-accent) 58%, white 12%);
  background:
    linear-gradient(145deg, rgb(45 139 127 / 0.22), transparent 52%),
    rgb(3 27 39 / 0.68);
}

.team-robot-bridge h3 {
  margin-bottom: 9px;
}

.team-robot-bridge > p {
  margin: 0;
  color: #d3e3d9;
  font-size: 0.84rem;
  line-height: 1.6;
}

.team-robot-responses {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.team-robot-responses span {
  border-left: 3px solid var(--team-accent);
  padding: 5px 0 5px 9px;
  color: #fff1cc;
  font-size: 0.78rem;
  font-weight: 900;
}

.team-showcase-interactions {
  display: grid;
  gap: 9px;
}

.team-interaction-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.team-interaction-buttons button {
  min-height: 38px;
  border: 1px solid rgb(255 236 191 / 0.3);
  border-radius: 4px;
  padding: 8px 11px;
  color: #fff4db;
  font-size: 0.77rem;
  font-weight: 900;
  background: rgb(255 255 255 / 0.08);
}

.team-interaction-buttons button:hover {
  border-color: var(--team-accent);
  background: rgb(255 255 255 / 0.15);
}

.team-ai-builder {
  grid-column: 1 / -1;
  border: 1px solid #d4bd9f;
  border-radius: var(--radius);
  padding: clamp(18px, 3vw, 30px);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgb(255 255 255 / 0.82), transparent 60%),
    #fff8e9;
}

.team-ai-builder-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.team-ai-builder h3 {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.team-ai-builder-heading > strong {
  border-left: 3px solid var(--gold);
  padding: 5px 0 5px 9px;
  color: #6c4a2d;
  font-size: 0.78rem;
}

.team-ai-builder-intro {
  max-width: 68em;
  margin: 0 0 17px;
  color: var(--muted);
  line-height: 1.65;
}

.team-ai-builder-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.team-ai-builder-form label {
  display: grid;
  gap: 6px;
  color: #4d3b2e;
  font-size: 0.82rem;
  font-weight: 900;
}

.team-ai-builder-form label:nth-child(3),
.team-ai-builder-form label:nth-child(4),
.team-ai-builder-form label:nth-child(5),
.team-ai-builder-actions,
.team-studio-status {
  grid-column: 1 / -1;
}

.team-ai-builder-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  border: 1px solid #d9c8af;
  border-radius: 5px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
}

.team-ai-builder-form textarea::placeholder {
  color: #9a8878;
}

.team-ai-builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 3px;
}

.team-ai-builder-actions .student-secondary {
  color: #6b412c;
  border-color: #c89a70;
  background: #fff2dc;
}

.team-studio-status {
  min-height: 1.5em;
  margin: 0;
  color: #765b47;
  font-size: 0.82rem;
  line-height: 1.5;
}

.student-path {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.student-path a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  min-height: 104px;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--surface-strong);
}

.student-path a:hover {
  background: #fff4dd;
}

.student-path span {
  grid-row: 1 / span 2;
  color: var(--cinnabar);
  font-size: 1.35rem;
  font-weight: 950;
}

.student-path strong {
  align-self: end;
  font-size: 1.08rem;
}

.student-path small {
  color: var(--muted);
  line-height: 1.4;
}

.student-archives,
.student-ask,
.team-studio,
.team-directory {
  border-radius: var(--radius);
}

.student-archives,
.team-directory {
  padding: clamp(26px, 4vw, 52px);
  background: #e6f0ee;
}

.student-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.student-section-heading .student-kicker,
.student-ask .student-kicker,
.student-login-dialog .student-kicker {
  color: var(--cinnabar);
}

.student-section-heading h2,
.student-ask h2,
.team-studio h2 {
  max-width: 16ch;
  margin: 0;
}

.student-resource-rail {
  display: grid;
  grid-auto-columns: minmax(220px, 1fr);
  grid-auto-flow: column;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}

.resource-discovery-card {
  display: grid;
  grid-template-rows: 156px auto;
  min-width: 220px;
  overflow: hidden;
  border: 1px solid rgb(20 58 88 / 0.16);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fffdf7;
  scroll-snap-align: start;
}

.resource-discovery-card img,
.resource-discovery-card .resource-art {
  width: 100%;
  height: 156px;
  object-fit: cover;
  background: #193e50;
}

.resource-discovery-card > div {
  padding: 14px;
}

.resource-discovery-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.resource-discovery-card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.resource-discovery-card small {
  display: block;
  border-top: 1px solid #eadfce;
  padding-top: 9px;
  color: #7d6050;
  font-size: 0.72rem;
  line-height: 1.45;
}

.student-ask {
  padding: clamp(30px, 5vw, 68px);
  color: #fff8eb;
  background: #153b57;
}

.student-ask-intro {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 750px;
  margin-bottom: 28px;
}

.student-ask-intro h2 {
  margin-bottom: 8px;
}

.student-ask-intro p:not(.student-kicker) {
  margin: 0;
  color: #d9e4df;
  line-height: 1.7;
}

.mini-guide-avatar,
.login-guide-avatar {
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border: 2px solid rgb(255 197 107 / 0.72);
  border-radius: 50%;
  background: #0d2737;
}

.mini-guide-avatar img,
.login-guide-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.42) hue-rotate(340deg) saturate(1.05) brightness(0.8);
}

.student-chat-layout,
.team-studio-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.74fr) minmax(0, 1.26fr);
  gap: 18px;
}

.student-question-form,
.student-answer,
.work-submission,
.virtual-hall {
  border: 1px solid rgb(255 245 224 / 0.21);
  border-radius: var(--radius);
}

.student-question-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 20px;
  background: rgb(5 25 39 / 0.38);
}

.student-question-form label {
  color: #ffc56b;
  font-weight: 900;
}

.student-question-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid rgb(255 245 224 / 0.36);
  border-radius: var(--radius);
  padding: 12px;
  color: #fff9ed;
  background: rgb(5 20 33 / 0.54);
}

.student-question-form textarea::placeholder {
  color: #c8d2ca;
}

.question-suggestions button,
.robot-intent-row button {
  border: 1px solid rgb(255 245 224 / 0.22);
  border-radius: var(--radius);
  padding: 8px 9px;
  color: #e9f1e8;
  font-size: 0.8rem;
  font-weight: 750;
  text-align: left;
  background: rgb(255 255 255 / 0.08);
}

.student-answer {
  min-height: 330px;
  padding: 20px;
  color: var(--ink);
  background: #fffaf0;
}

.student-answer-heading,
.virtual-hall-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.student-answer-heading span,
.virtual-hall-heading span {
  display: block;
  color: var(--cinnabar);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.student-answer-heading strong {
  display: block;
  margin-top: 3px;
  font-size: 1.08rem;
}

.voice-button {
  min-height: 38px;
  padding: 7px 10px;
  border-color: var(--line);
  color: var(--star-blue);
  background: #fff;
}

.voice-button:disabled {
  cursor: not-allowed;
}

#answerText {
  margin: 18px 0 16px;
  line-height: 1.75;
}

.answer-media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.answer-media img,
.answer-media video {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 5px;
  object-fit: cover;
  background: #d9e4df;
}

.answer-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.answer-sources a,
.answer-sources span {
  border-left: 2px solid var(--gold);
  padding-left: 8px;
  color: #665546;
  font-size: 0.76rem;
  line-height: 1.35;
}

.team-studio {
  padding: clamp(28px, 5vw, 64px);
  background: #f4ead7;
}

.team-heading {
  align-items: center;
}

.team-identity {
  min-width: 166px;
  border: 1px solid #d7b480;
  border-radius: var(--radius);
  padding: 11px 14px;
  color: #5f4733;
  font-weight: 900;
  text-align: center;
  background: #fff8e9;
}

.work-submission,
.virtual-hall {
  padding: 20px;
  color: var(--ink);
  border-color: #d7c5ad;
  background: #fffdf8;
}

.work-submission h3,
.virtual-hall h3 {
  margin: 0 0 8px;
  font-size: 1.22rem;
}

.work-submission > p {
  color: var(--muted);
  line-height: 1.58;
}

.work-submission form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.work-submission label,
.student-login-dialog label {
  display: grid;
  gap: 6px;
  color: #4c3c30;
  font-size: 0.86rem;
  font-weight: 900;
}

.work-submission input,
.work-submission textarea,
.student-login-dialog input {
  width: 100%;
  border: 1px solid #d9c8af;
  border-radius: 5px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
}

.work-file-field {
  border: 1px dashed #bb8c54;
  border-radius: var(--radius);
  padding: 12px;
  background: #fff6e2;
}

.work-status,
.sync-feed,
.login-status {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: #70553d;
  font-size: 0.84rem;
  line-height: 1.5;
}

.virtual-hall {
  overflow: hidden;
  background: #eef2eb;
}

.virtual-hall-heading {
  margin-bottom: 14px;
}

.virtual-hall-scene {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid #a6c4bd;
  border-radius: 5px;
  background: #173f50;
  perspective: 520px;
}

.hall-sky,
.hall-floor,
.hall-wall {
  position: absolute;
  pointer-events: none;
}

.hall-sky {
  inset: 0 0 48%;
  background:
    radial-gradient(circle at 18% 22%, #ffe4a2 0 1px, transparent 1.7px),
    radial-gradient(circle at 76% 34%, #ffe4a2 0 1px, transparent 1.7px),
    linear-gradient(180deg, #132d42, #285b68);
  background-size: 72px 64px, 95px 84px, auto;
}

.hall-floor {
  inset: 44% -10% -22%;
  transform: rotateX(63deg);
  transform-origin: top;
  border-top: 1px solid rgb(255 239 193 / 0.46);
  background:
    repeating-linear-gradient(90deg, rgb(246 218 158 / 0.24) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, rgb(246 218 158 / 0.16) 0 1px, transparent 1px 38px),
    #355958;
}

.hall-wall {
  top: 18%;
  width: 22%;
  height: 64%;
  background: linear-gradient(180deg, #496755, #253d43);
}

.wall-left {
  left: -10%;
  transform: skewY(24deg);
}

.wall-right {
  right: -10%;
  transform: skewY(-24deg);
}

.virtual-avatar {
  position: absolute;
  z-index: 3;
  left: 2%;
  bottom: 52%;
  display: grid;
  place-items: center;
  width: 82px;
  transition: left 820ms cubic-bezier(0.16, 1, 0.3, 1), bottom 820ms cubic-bezier(0.16, 1, 0.3, 1), transform 820ms cubic-bezier(0.16, 1, 0.3, 1);
}

.virtual-avatar img {
  width: 58px;
  height: 58px;
  border: 2px solid #ffc56b;
  border-radius: 50%;
  object-fit: cover;
  filter: sepia(0.34) saturate(1.1) brightness(0.94);
  background: #dbeae5;
}

.virtual-avatar span {
  margin-top: -2px;
  border: 1px solid rgb(255 244 220 / 0.36);
  border-radius: 5px;
  padding: 2px 6px;
  color: #fff8e8;
  font-size: 0.72rem;
  font-weight: 900;
  background: rgb(7 28 42 / 0.74);
}

.virtual-hall-scene[data-state="welcome"] .virtual-avatar {
  left: 68%;
  bottom: 38%;
  transform: rotate(8deg) scale(1.08);
}

.virtual-hall-scene[data-state="patrol"] .virtual-avatar {
  left: 44%;
  bottom: 32%;
  transform: rotate(-6deg);
}

.virtual-hall-scene[data-state="celebrate"] .virtual-avatar {
  left: 78%;
  bottom: 28%;
  transform: translateY(-16px) rotate(10deg);
}

.exhibit-slots {
  position: absolute;
  z-index: 2;
  inset: 18% 9% 20%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.virtual-exhibit {
  align-self: end;
  min-height: 86px;
  overflow: hidden;
  border: 2px solid rgb(255 225 160 / 0.62);
  border-radius: 4px;
  color: #fff8e8;
  background: #28444b;
  box-shadow: 0 12px 24px rgb(0 0 0 / 0.24);
}

.virtual-exhibit img {
  display: block;
  width: 100%;
  height: 76px;
  object-fit: cover;
}

.virtual-exhibit strong {
  display: block;
  padding: 6px;
  font-size: 0.72rem;
  line-height: 1.2;
}

.virtual-exhibit.placeholder {
  display: grid;
  place-items: center;
  padding: 8px;
  color: #d7e6df;
  font-size: 0.74rem;
  line-height: 1.35;
  text-align: center;
  background: linear-gradient(145deg, #35535b, #244247);
}

.robot-intent-row {
  margin-top: 12px;
}

.robot-intent-row button {
  color: #4a3726;
  background: #fff5df;
  border-color: #dec9a6;
}

.team-directory-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.team-directory-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  border: 1px solid #b7d0c8;
  border-radius: var(--radius);
  padding: 13px;
  color: var(--ink);
  text-decoration: none;
  background: #fffdf7;
}

.team-directory-card:hover {
  border-color: #4e8e86;
  transform: translateY(-1px);
}

.team-directory-card .team-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  font-weight: 950;
  background: #2d8b7f;
}

.team-directory-card strong,
.team-directory-card small {
  display: block;
}

.team-directory-card small {
  margin-top: 4px;
  color: var(--muted);
}

.student-login-dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid #dcc6a7;
  border-radius: var(--radius);
  padding: 0;
  color: var(--ink);
  background: #fffaf0;
  box-shadow: 0 28px 70px rgb(7 18 31 / 0.42);
}

.student-login-dialog::backdrop {
  background: rgb(5 22 35 / 0.72);
  backdrop-filter: blur(4px);
}

.student-login-dialog form {
  display: grid;
  gap: 13px;
  padding: 28px;
}

.student-login-dialog h2 {
  margin: -4px 0 0;
  font-size: 2rem;
}

.student-login-dialog form > p:not(.student-kicker):not(.login-status) {
  margin: 0 0 4px;
  color: var(--muted);
  line-height: 1.6;
}

.login-guide-avatar {
  width: 72px;
  height: 72px;
}

.dialog-close {
  justify-self: end;
  border: 0;
  padding: 4px;
  color: #715f4f;
  background: transparent;
  font-weight: 900;
}

@media (max-width: 980px) {
  .student-hero-copy {
    width: min(620px, 68%);
  }

  .guide-portrait {
    right: 20px;
    width: 310px;
    min-width: 0;
  }

  .student-chat-layout,
  .team-studio-grid {
    grid-template-columns: 1fr;
  }

  .team-showcase-meta {
    grid-template-columns: 1fr;
  }

  .team-showcase-focus {
    justify-content: start;
  }

  .team-showcase-chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-directory-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .student-hero {
    min-height: 720px;
  }

  .team-showcase,
  .team-showcase-overlay {
    min-height: 0;
  }

  .team-showcase-head,
  .team-ai-builder-heading {
    flex-direction: column;
  }

  .team-showcase-head h2 {
    max-width: 11ch;
    font-size: clamp(2.3rem, 11vw, 3.8rem);
  }

  .team-showcase-grid,
  .team-showcase-chapters,
  .team-ai-builder-form {
    grid-template-columns: 1fr;
  }

  .team-showcase-chapter {
    min-height: 0;
  }

  .team-ai-builder-form label:nth-child(3),
  .team-ai-builder-form label:nth-child(4),
  .team-ai-builder-form label:nth-child(5),
  .team-ai-builder-actions,
  .team-studio-status {
    grid-column: auto;
  }

  .team-ai-builder-actions > button {
    width: 100%;
  }

  .student-hero-copy {
    justify-content: flex-start;
    width: 100%;
    min-height: auto;
    padding: 32px 22px;
  }

  .student-hero h1 {
    max-width: 11ch;
    font-size: clamp(2.9rem, 12vw, 3.8rem);
  }

  .guide-portrait {
    top: auto;
    right: 12px;
    bottom: 88px;
    width: 236px;
  }

  .guide-portrait-copy {
    right: -4%;
    bottom: 0;
  }

  .student-session-strip {
    left: 18px;
    bottom: 18px;
  }

  .hero-motion-toggle {
    right: 18px;
    bottom: 18px;
  }

  .student-path,
  .team-directory-list {
    grid-template-columns: 1fr;
  }

  .teacher-task-item {
    align-items: stretch;
    flex-direction: column;
  }

  .student-section-heading,
  .team-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .student-resource-rail {
    grid-auto-columns: minmax(245px, 82vw);
  }

  .student-archives,
  .student-ask,
  .team-studio,
  .team-directory {
    padding: 24px 18px;
  }

  .student-hero-actions .student-primary,
  .student-hero-actions .student-secondary,
  .student-question-form .student-primary,
  .work-submission .student-primary {
    width: 100%;
    position: relative;
    z-index: 4;
    color: #fff9ee;
    text-shadow: 0 1px 1px rgb(0 0 0 / 0.22);
  }

  .mini-guide-avatar {
    width: 70px;
    height: 70px;
  }
}

/* Live mission theatre: the shared moment where virtual discovery reaches the real LEGO field. */
.live-mission {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  scroll-margin-top: 96px;
  padding: clamp(22px, 4vw, 52px);
  border: 1px solid rgb(244 205 133 / 0.28);
  border-radius: var(--radius);
  color: #fff7e7;
  background:
    linear-gradient(120deg, rgb(9 29 40 / 0.96), rgb(13 50 61 / 0.91) 54%, rgb(90 43 30 / 0.84)),
    #0b2634;
  box-shadow: 0 28px 72px rgb(8 22 32 / 0.22);
}

.live-mission::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.44;
  background:
    repeating-linear-gradient(90deg, transparent 0 57px, rgb(255 229 175 / 0.06) 58px 59px),
    repeating-linear-gradient(0deg, transparent 0 57px, rgb(255 229 175 / 0.04) 58px 59px);
  pointer-events: none;
}

.live-mission-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.live-mission-header .student-kicker {
  margin-bottom: 8px;
}

.live-mission-header h2 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(2rem, 4.3vw, 4.15rem);
  line-height: 1.06;
}

.stage-mode-button {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid rgb(255 227 166 / 0.52);
  border-radius: 5px;
  padding: 10px 14px;
  color: #fff6df;
  font-weight: 900;
  background: rgb(7 28 39 / 0.56);
  box-shadow: inset 0 1px rgb(255 247 225 / 0.12);
}

.stage-mode-button:hover,
.stage-mode-button:focus-visible {
  outline: 0;
  border-color: #ffc56b;
  background: rgb(142 63 40 / 0.86);
}

.mission-stage-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(195px, 0.7fr) minmax(420px, 1.58fr) minmax(205px, 0.72fr);
  gap: 12px;
  align-items: stretch;
}

.mission-console,
.mission-physical-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgb(255 237 202 / 0.2);
  border-radius: 5px;
  padding: clamp(16px, 2.2vw, 25px);
  background: rgb(4 23 33 / 0.68);
  backdrop-filter: blur(12px);
}

.mission-label {
  display: block;
  margin-bottom: 9px;
  color: #ffc56b;
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.mission-console h3,
.mission-physical-panel h3 {
  margin: 0 0 10px;
  color: #fff8ea;
  font-size: clamp(1.1rem, 1.65vw, 1.4rem);
  line-height: 1.28;
}

.mission-console > p:not(.mission-action-hint) {
  margin: 0;
  color: #d5e2d9;
  font-size: 0.91rem;
  line-height: 1.7;
}

.mission-choice-grid {
  display: grid;
  gap: 8px;
  margin: 20px 0 14px;
}

.mission-choice-grid button {
  min-height: 46px;
  border: 1px solid rgb(255 229 178 / 0.24);
  border-radius: 4px;
  padding: 9px 10px;
  color: #fbf1df;
  font-size: 0.86rem;
  font-weight: 900;
  text-align: left;
  background: rgb(255 255 255 / 0.07);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.mission-choice-grid button:hover,
.mission-choice-grid button.is-selected {
  border-color: #ffc56b;
  background: rgb(177 72 42 / 0.46);
}

.mission-choice-grid button:active {
  transform: translateY(1px);
}

.mission-choice-grid button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.mission-action-hint {
  margin: auto 0 0;
  border-top: 1px solid rgb(255 235 197 / 0.17);
  padding-top: 12px;
  color: #cbdcd4;
  font-size: 0.79rem;
  line-height: 1.58;
}

.mission-digital-stage {
  position: relative;
  min-height: 454px;
  overflow: hidden;
  border: 1px solid rgb(255 222 157 / 0.38);
  border-radius: 5px;
  background: #092c3b;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 20px 46px rgb(0 0 0 / 0.18);
}

.mission-digital-stage > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) contrast(1.14) brightness(0.64);
  transform: scale(1.035);
  transition: filter 700ms ease, transform 1000ms ease;
}

.mission-stage-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(4 20 30 / 0.18), rgb(4 20 30 / 0.76) 75%),
    linear-gradient(90deg, rgb(4 24 34 / 0.46), transparent 52%, rgb(110 46 28 / 0.32));
}

.mission-celestial-ring {
  position: absolute;
  top: 12%;
  left: 50%;
  width: min(48%, 260px);
  aspect-ratio: 1;
  border: 1px solid rgb(255 226 155 / 0.46);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 56px rgb(255 190 91 / 0.16), inset 0 0 34px rgb(255 214 129 / 0.12);
  animation: mission-ring-turn 30s linear infinite;
}

.mission-celestial-ring::before,
.mission-celestial-ring::after,
.mission-celestial-ring span {
  content: "";
  position: absolute;
  border: 1px solid rgb(127 212 195 / 0.42);
  border-radius: 50%;
}

.mission-celestial-ring::before {
  inset: 15%;
}

.mission-celestial-ring::after {
  inset: 34%;
  border-color: rgb(255 207 119 / 0.56);
}

.mission-celestial-ring span:nth-child(1) {
  top: -4px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-color: #ffe4a4;
  background: #ffe4a4;
  box-shadow: 0 0 16px #ffe4a4;
}

.mission-celestial-ring span:nth-child(2) {
  right: 4%;
  bottom: 18%;
  width: 7px;
  height: 7px;
  border-color: #8ee2cf;
  background: #8ee2cf;
  box-shadow: 0 0 14px #8ee2cf;
}

.mission-celestial-ring span:nth-child(3) {
  bottom: 6%;
  left: 17%;
  width: 6px;
  height: 6px;
  border-color: #ffc56b;
  background: #ffc56b;
  box-shadow: 0 0 13px #ffc56b;
}

@keyframes mission-ring-turn {
  to { transform: translateX(-50%) rotate(360deg); }
}

.mission-stage-status {
  position: absolute;
  z-index: 3;
  top: 17px;
  left: 18px;
  display: grid;
  gap: 2px;
  border-left: 3px solid #ffc56b;
  padding: 7px 10px;
  color: #fff5dd;
  background: rgb(3 20 31 / 0.62);
  backdrop-filter: blur(10px);
}

.mission-stage-status span {
  color: #ffd07f;
  font-size: 0.75rem;
  font-weight: 900;
}

.mission-stage-status strong {
  font-size: 0.96rem;
}

.mission-robot-lane {
  position: absolute;
  z-index: 4;
  right: 14px;
  bottom: 14px;
  left: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.mission-robot-role {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 65px;
  border: 1px solid rgb(255 239 205 / 0.2);
  border-radius: 4px;
  padding: 7px;
  color: #fff8e9;
  background: rgb(3 22 32 / 0.72);
  transition: transform 400ms ease, border-color 400ms ease, background 400ms ease;
  backdrop-filter: blur(9px);
}

.mission-robot-role img {
  width: 42px;
  height: 42px;
  border: 1px solid rgb(255 213 132 / 0.56);
  border-radius: 50%;
  object-fit: cover;
  filter: sepia(0.36) hue-rotate(336deg) saturate(1.04) brightness(0.9);
}

.mission-robot-role span,
.mission-robot-role strong,
.mission-robot-role small {
  display: block;
  min-width: 0;
}

.mission-robot-role span {
  color: #ffc56b;
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.mission-robot-role strong {
  overflow: hidden;
  margin: 1px 0;
  font-size: 0.76rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mission-robot-role small {
  color: #d4e0d9;
  font-size: 0.66rem;
  line-height: 1.2;
}

.mission-robot-role.is-active,
.mission-robot-role[data-role-state="running"] {
  border-color: #ffe0a0;
  background: rgb(162 69 39 / 0.7);
  box-shadow: 0 0 0 1px rgb(255 211 127 / 0.24), 0 0 24px rgb(255 174 85 / 0.22);
  transform: translateY(-5px);
}

.mission-robot-role[data-role-state="completed"] {
  border-color: rgb(119 215 188 / 0.68);
}

.mission-robot-role[data-role-state="blocked"] {
  border-color: rgb(245 143 116 / 0.8);
}

.mission-digital-stage[data-mission-state="star"] > img {
  filter: saturate(0.88) contrast(1.17) brightness(0.75) sepia(0.1);
  transform: scale(1.075);
}

.mission-digital-stage[data-mission-state="star"] .mission-celestial-ring {
  border-color: #ffe59f;
  box-shadow: 0 0 70px rgb(255 197 80 / 0.32), inset 0 0 46px rgb(255 219 133 / 0.2);
  animation-duration: 16s;
}

.mission-digital-stage[data-mission-state="guardian"] .mission-stage-scrim {
  background:
    linear-gradient(180deg, rgb(6 77 67 / 0.1), rgb(4 32 36 / 0.7) 76%),
    linear-gradient(90deg, rgb(15 101 84 / 0.52), transparent 70%);
}

.mission-digital-stage[data-mission-state="guardian"] .mission-celestial-ring {
  border-color: #8fe1c8;
  box-shadow: 0 0 74px rgb(79 203 166 / 0.28), inset 0 0 44px rgb(107 221 190 / 0.16);
}

.mission-digital-stage[data-mission-state="signal"] > img {
  filter: saturate(1.04) contrast(1.16) brightness(0.78) sepia(0.18);
}

.mission-digital-stage[data-mission-state="signal"] .mission-celestial-ring {
  animation-duration: 9s;
  box-shadow: 0 0 84px rgb(255 145 74 / 0.42), inset 0 0 46px rgb(255 218 133 / 0.22);
}

.physical-role-list {
  display: grid;
  gap: 0;
  margin: 8px 0 18px;
  padding: 0;
  list-style: none;
}

.physical-spike-figure {
  display: grid;
  grid-template-columns: minmax(92px, 0.72fr) minmax(0, 1.28fr);
  gap: 11px;
  align-items: center;
  margin: 4px 0 12px;
  border: 1px solid rgb(255 221 156 / 0.3);
  border-radius: 5px;
  padding: 8px;
  background:
    linear-gradient(135deg, rgb(255 197 107 / 0.11), transparent 44%),
    rgb(5 31 38 / 0.72);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.04), 0 12px 26px rgb(0 0 0 / 0.12);
}

.physical-spike-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgb(255 210 125 / 0.56);
  border-radius: 4px;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.08);
}

.physical-spike-figure figcaption {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.physical-spike-figure figcaption span,
.physical-spike-figure figcaption strong,
.physical-spike-figure figcaption small {
  display: block;
}

.physical-spike-figure figcaption span {
  color: #81dbc3;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.physical-spike-figure figcaption strong {
  color: #fff5df;
  font-size: 0.92rem;
  line-height: 1.25;
}

.physical-spike-figure figcaption small {
  color: #cbded5;
  font-size: 0.73rem;
  line-height: 1.45;
}

.physical-role-list li {
  display: grid;
  gap: 3px;
  border-top: 1px solid rgb(255 240 213 / 0.16);
  padding: 12px 0;
}

.physical-role-list strong {
  color: #ffc56b;
  font-size: 0.82rem;
}

.physical-role-list span {
  color: #d5e2d9;
  font-size: 0.81rem;
  line-height: 1.45;
}

.physical-sync-status {
  margin-top: auto;
  border-left: 3px solid #81949a;
  padding: 10px 0 10px 11px;
  color: #dae5df;
  font-size: 0.83rem;
  font-weight: 800;
  line-height: 1.45;
}

.physical-sync-status[data-state="planned"],
.physical-sync-status[data-state="ready"],
.physical-sync-status[data-state="syncing"] {
  border-color: #ffc56b;
  color: #ffe2ad;
}

.physical-sync-status[data-state="running"] {
  border-color: #85dfc4;
  color: #c9f1e3;
}

.physical-sync-status[data-state="completed"],
.physical-sync-status[data-state="online"] {
  border-color: #67caa9;
  color: #bfe9d8;
}

.physical-sync-status[data-state="blocked"] {
  border-color: #f39779;
  color: #ffd0c0;
}

.mission-audience-footer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 13px;
  border-top: 1px solid rgb(255 238 208 / 0.17);
  padding-top: 14px;
}

.mission-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mission-counts span {
  border-left: 2px solid rgb(255 197 107 / 0.7);
  padding: 3px 0 3px 8px;
  color: #d7e3dc;
  font-size: 0.76rem;
  font-weight: 800;
}

.mission-counts b {
  color: #fff4d8;
  font-size: 1.12rem;
}

.mission-event-log {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mission-event-log li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #cfddd6;
  font-size: 0.78rem;
  line-height: 1.45;
}

.mission-event-log strong {
  color: #ffc56b;
}

.live-mission:fullscreen {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
  padding: clamp(22px, 4vw, 54px);
}

.live-mission:fullscreen .mission-stage-layout {
  flex: 1;
  min-height: 0;
}

.live-mission:fullscreen .mission-digital-stage {
  min-height: min(62dvh, 680px);
}

.student-experience > *,
.mission-stage-layout > * {
  min-width: 0;
}

@media (max-width: 1120px) {
  .mission-stage-layout {
    grid-template-columns: minmax(210px, 0.72fr) minmax(410px, 1.45fr);
  }

  .mission-physical-panel {
    grid-column: 1;
  }

  .mission-digital-stage {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (max-width: 1180px) {
  .workspace,
  .student-experience {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .live-mission {
    padding: 22px 16px;
    scroll-margin-top: 146px;
  }

  .live-mission-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .live-mission-header h2 {
    max-width: 13ch;
    font-size: clamp(2rem, 10vw, 3.1rem);
  }

  .stage-mode-button {
    width: 100%;
  }

  .mission-stage-layout {
    grid-template-columns: 1fr;
  }

  .mission-digital-stage,
  .mission-physical-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .mission-digital-stage {
    min-height: 410px;
  }

  .mission-robot-lane {
    grid-template-columns: 1fr;
  }

  .mission-robot-role {
    min-height: 47px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 4px 6px;
  }

  .mission-robot-role img {
    width: 34px;
    height: 34px;
  }

  .mission-robot-role div {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 5px;
  }

  .mission-robot-role span,
  .mission-robot-role strong,
  .mission-robot-role small {
    white-space: nowrap;
  }

  .mission-robot-role span {
    font-size: 0.58rem;
  }

  .mission-robot-role strong {
    margin: 0;
    font-size: 0.7rem;
  }

  .mission-robot-role small {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mission-audience-footer {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* AI film lab: a studio surface for turning research and LEGO work into short-form stories. */
.ai-video-lab {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  scroll-margin-top: 96px;
  display: grid;
  grid-template-columns: minmax(240px, 0.68fr) minmax(0, 1.32fr);
  gap: clamp(24px, 4.4vw, 68px);
  padding: clamp(30px, 5vw, 68px);
  border-radius: var(--radius);
  color: #fff8e8;
  background: #193c42;
}

.ai-video-lab::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: url("/content/xjtu_mural_tomb/sources/digital_vr/assets/FD1284D642B25D63CA04A34E772_E36441EB_4F02-a523179a34.jpg") center / cover;
  filter: saturate(0.65) contrast(1.15) brightness(0.44);
}

.ai-video-lab::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgb(10 31 38 / 0.96), rgb(14 57 63 / 0.88) 50%, rgb(126 52 35 / 0.78));
}

.video-lab-intro {
  align-self: center;
}

.video-lab-intro .student-kicker {
  margin-bottom: 8px;
}

.video-lab-intro h2 {
  max-width: 10ch;
  margin: 0 0 15px;
  font-size: clamp(2.25rem, 4.2vw, 4.2rem);
  line-height: 1.04;
}

.video-lab-intro > p:not(.student-kicker) {
  max-width: 31em;
  margin: 0;
  color: #dde6da;
  line-height: 1.75;
}

.video-lab-stages {
  display: grid;
  gap: 9px;
  margin-top: 28px;
}

.video-lab-stages span {
  border-left: 3px solid #ffc56b;
  padding: 5px 0 5px 10px;
  color: #f5e7cd;
  font-size: 0.83rem;
  font-weight: 900;
}

.video-lab-workspace {
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(300px, 1.18fr);
  gap: 12px;
  min-width: 0;
}

.video-story-form,
.video-story-output {
  min-width: 0;
  border: 1px solid rgb(255 239 207 / 0.23);
  border-radius: 5px;
  padding: clamp(17px, 2.3vw, 25px);
  background: rgb(4 26 31 / 0.62);
  backdrop-filter: blur(13px);
}

.video-story-form {
  display: grid;
  align-content: start;
  gap: 12px;
}

.video-story-form label {
  display: grid;
  gap: 6px;
  color: #ffe3ad;
  font-size: 0.82rem;
  font-weight: 900;
}

.video-story-form input,
.video-story-form textarea,
.video-story-form select {
  width: 100%;
  border: 1px solid rgb(255 239 207 / 0.3);
  border-radius: 4px;
  padding: 10px;
  color: #fff9ea;
  background: rgb(2 20 26 / 0.48);
}

.video-story-form textarea {
  resize: vertical;
  min-height: 102px;
  line-height: 1.58;
}

.video-story-form select option {
  color: #17202c;
  background: #fffaf0;
}

.video-story-form input::placeholder,
.video-story-form textarea::placeholder {
  color: #c3d1c8;
}

.video-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.video-story-form .student-primary {
  width: 100%;
  margin-top: 2px;
}

.video-story-status {
  min-height: 2.8em;
  margin: 0;
  color: #c9ddd2;
  font-size: 0.78rem;
  line-height: 1.48;
}

.video-story-output-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.video-story-output-heading span,
.video-story-output-heading strong {
  display: block;
}

.video-story-output-heading span {
  color: #ffc56b;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.video-story-output-heading strong {
  margin-top: 3px;
  font-size: 1.08rem;
}

.video-preview-frame {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  border: 1px solid rgb(255 223 160 / 0.38);
  border-radius: 4px;
  background: #092d38;
}

.video-preview-frame > img,
.video-preview-frame > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.77) contrast(1.13) brightness(0.63);
}

.video-preview-frame > div {
  position: absolute;
  z-index: 1;
  right: 12px;
  bottom: 12px;
  max-width: 70%;
  border-left: 3px solid #ffc56b;
  padding: 6px 0 6px 9px;
  color: #fff9e8;
  background: rgb(4 22 29 / 0.66);
}

.video-preview-frame span,
.video-preview-frame strong {
  display: block;
}

.video-preview-frame span {
  color: #ffc56b;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.video-preview-frame strong {
  margin-top: 2px;
  font-size: 0.87rem;
}

.video-preview-frame[data-state="completed"] {
  border-color: #86ddc3;
}

.video-preview-frame[data-state="submitted"] {
  border-color: #ffc56b;
}

.video-preview-frame[data-state="provider_error"] {
  border-color: #f39779;
}

.video-story-narration {
  margin: 14px 0 12px;
  color: #e5eee6;
  font-size: 0.9rem;
  line-height: 1.67;
}

.video-storyboard-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.video-storyboard-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid rgb(255 239 207 / 0.16);
  padding-top: 8px;
  color: #cfe0d7;
  font-size: 0.76rem;
  line-height: 1.45;
}

.video-storyboard-list li strong {
  color: #ffd681;
  white-space: nowrap;
}

.video-story-history {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.video-story-history button {
  border: 1px solid rgb(255 239 207 / 0.24);
  border-radius: 4px;
  padding: 6px 8px;
  color: #f5e8d0;
  font-size: 0.72rem;
  font-weight: 850;
  background: rgb(255 255 255 / 0.07);
}

.video-story-history button:hover,
.video-story-history button.is-selected {
  border-color: #ffc56b;
  background: rgb(163 69 41 / 0.62);
}

@media (max-width: 1120px) {
  .ai-video-lab {
    grid-template-columns: 1fr;
  }

  .video-lab-intro h2 {
    max-width: 14ch;
  }
}

@media (max-width: 760px) {
  .ai-video-lab {
    padding: 28px 18px;
    scroll-margin-top: 146px;
  }

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

  .video-field-grid {
    grid-template-columns: 1fr;
  }
}

/* LEGO hands-on controls inside the live mission: build first, then rehearse. */
.spike-build-deck {
  margin: 4px 0 16px;
  border-top: 1px solid rgb(255 240 213 / 0.16);
  padding-top: 14px;
}

.spike-build-heading span,
.spike-build-heading strong {
  display: block;
}

.spike-build-heading span {
  color: #81dbc3;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.spike-build-heading strong {
  margin-top: 2px;
  color: #fff5e1;
  font-size: 0.96rem;
}

.spike-module-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.spike-module-picker button {
  min-height: 64px;
  border: 1px solid rgb(255 240 213 / 0.2);
  border-radius: 4px;
  padding: 7px;
  color: #e6f3e9;
  text-align: left;
  background: rgb(255 255 255 / 0.06);
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.spike-module-picker button span,
.spike-module-picker button small {
  display: block;
}

.spike-module-picker button span {
  color: #fff6df;
  font-size: 0.73rem;
  font-weight: 900;
}

.spike-module-picker button small {
  margin-top: 3px;
  color: #c9ded4;
  font-size: 0.64rem;
  line-height: 1.25;
}

.spike-module-picker button.is-selected {
  border-color: #7ee1c5;
  background: rgb(45 139 127 / 0.34);
  box-shadow: inset 0 0 0 1px rgb(126 225 197 / 0.2);
}

.spike-module-picker button.is-required:not(.is-selected) {
  border-color: rgb(255 197 107 / 0.74);
}

.spike-module-picker button:active {
  transform: translateY(1px);
}

.spike-build-status {
  min-height: 2.5em;
  margin: 9px 0 0;
  color: #cde1d8;
  font-size: 0.73rem;
  line-height: 1.45;
}

.mission-command-deck {
  position: relative;
  z-index: 2;
  margin-top: 12px;
  border: 1px solid rgb(255 237 200 / 0.2);
  border-radius: 5px;
  padding: clamp(14px, 2.4vw, 24px);
  background: rgb(3 24 33 / 0.5);
  backdrop-filter: blur(10px);
}

.mission-command-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.mission-command-heading span {
  display: block;
  color: #ffc56b;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.mission-command-heading h3 {
  margin: 3px 0 0;
  color: #fff7e7;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
}

.mission-command-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.trial-mission-button,
.reset-mission-button {
  min-height: 38px;
  border: 1px solid rgb(255 229 178 / 0.36);
  border-radius: 4px;
  padding: 7px 10px;
  color: #fff8e9;
  font-size: 0.78rem;
  font-weight: 900;
}

.trial-mission-button {
  background: #ae442d;
}

.reset-mission-button {
  background: rgb(255 255 255 / 0.07);
}

.mission-command-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
}

.mission-brick-bank,
.mission-command-rail {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 7px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mission-brick-bank button,
.mission-command-rail li {
  min-height: 38px;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.mission-brick-bank button {
  border: 1px solid rgb(118 220 201 / 0.44);
  color: #d5f5e9;
  background: rgb(45 139 127 / 0.24);
}

.mission-brick-bank button:disabled {
  cursor: not-allowed;
  border-color: rgb(255 239 207 / 0.16);
  color: #9eb8af;
  background: rgb(255 255 255 / 0.04);
}

.mission-command-rail {
  min-height: 52px;
  border: 1px dashed rgb(255 231 185 / 0.26);
  border-radius: 4px;
  padding: 7px;
  background: rgb(1 18 25 / 0.28);
}

.mission-command-rail li {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgb(255 201 110 / 0.56);
  color: #fff0d2;
  background: rgb(167 67 39 / 0.5);
}

.mission-command-rail li:not(.mission-command-slot) {
  cursor: pointer;
}

.mission-command-rail .mission-command-slot {
  border: 1px dashed rgb(255 231 185 / 0.22);
  color: #a9c6bc;
  background: transparent;
}

.mission-trial-status {
  min-height: 1.5em;
  margin: 11px 0 0;
  color: #d4e4dd;
  font-size: 0.77rem;
  line-height: 1.45;
}

.mission-digital-stage[data-trial-state="running"] .mission-robot-role {
  animation: spike-trial-run 1300ms cubic-bezier(0.15, 0.82, 0.32, 1) both;
}

.mission-digital-stage[data-trial-state="running"] .mission-robot-role:nth-child(2) {
  animation-delay: 90ms;
}

.mission-digital-stage[data-trial-state="running"] .mission-robot-role:nth-child(3) {
  animation-delay: 180ms;
}

@keyframes spike-trial-run {
  0% { transform: translateX(0) rotate(0); }
  45% { transform: translateX(-18px) rotate(-2deg); }
  75% { transform: translateX(9px) rotate(2deg); }
  100% { transform: translateX(0) rotate(0); }
}

@media (max-width: 760px) {
  .mission-command-heading,
  .mission-command-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .mission-command-actions {
    width: 100%;
  }

  .mission-command-actions button {
    width: 100%;
  }

  .mission-command-layout {
    grid-template-columns: 1fr;
  }
}
