:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  color: #e9edf2;
  background: #0b1014;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 18px 24px;
}
header.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #26323a;
  flex-wrap: wrap;
}
.brand {
  font-size: 28px;
  font-weight: 800;
  background: #183e3c;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #9de5cf;
}
.brand span {
  font-size: 16px;
}
.topbar-title {
  flex: 1;
  min-width: 280px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.eyebrow {
  font-size: 10.5px;
  letter-spacing: 1.6px;
  color: #87a39e;
  margin: 0 0 4px;
}
h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
}
h1 span {
  display: block;
  font-size: 12px;
  color: #92a1ae;
  font-weight: 400;
  margin-top: 4px;
}
.badge {
  color: #9bdbbf;
  border: 1px solid #31514a;
  border-radius: 30px;
  padding: 7px 13px;
  font-size: 11.5px;
}
main.arena-first-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-top: 14px;
  align-items: start;
}
.workspace,
aside.instructor-rail {
  background: #11191f;
  border: 1px solid #26343e;
  border-radius: 16px;
  overflow: hidden;
}
.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #131f27;
  border-bottom: 1px solid #1d2a33;
  flex-wrap: wrap;
}
.topline-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.status-text {
  font-size: 11.5px;
  font-weight: 600;
  color: #9de5cf;
}
canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  background: #0d141c;
}
.xr-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  background: #0d141c;
  border-bottom: 1px solid #24323b;
}
.xr-pane {
  border: 1px solid #263844;
  border-radius: 10px;
  overflow: hidden;
  background: #0d141c;
  position: relative;
}
.xr-pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 12px;
  background: #14222e;
  font-size: 11px;
  color: #a8c7d4;
  border-bottom: 1px solid #233642;
}
.runtime-safety-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #142029;
  border-bottom: 1px solid #24323b;
  flex-wrap: wrap;
}
.safety-controls,
.provenance-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.safety-pause-btn {
  background: #352614;
  border-color: #c28538;
  color: #ffcf91;
  font-weight: 600;
}
.safety-abort-btn {
  background: #421820;
  border-color: #d9485b;
  color: #ff9aa7;
  font-weight: 600;
}
.ghost-btn {
  background: #16242f;
  border-color: #345060;
  color: #cfe6f2;
}
.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid #34505e;
  background: #182832;
  color: #bfe2ee;
}
.pill.valid {
  border-color: #2e7d67;
  background: #13382f;
  color: #89dac8;
}
.pill.warn {
  border-color: #9a6e3e;
  background: #352614;
  color: #ffbf79;
}
.pill.fault {
  border-color: #9e3a48;
  background: #3b171e;
  color: #ff8594;
}
#enter-xr {
  background: #17493f;
  border-color: #55e6c1;
  color: #eafff8;
  font-weight: 600;
}
.settings-drawer {
  background: #0e161d;
}
.settings-drawer > summary {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 11.5px;
  color: #9bb4c2;
  user-select: none;
  border-bottom: 1px solid #1d2a33;
}
.settings-drawer-body {
  padding-bottom: 12px;
}
.xr-status-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: #131f27;
  border-bottom: 1px solid #24323b;
  font-size: 12px;
  align-items: center;
}
.subpanel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  background: #0f1820;
  border-bottom: 1px solid #24323b;
}
.subpanel {
  background: #13202a;
  border: 1px solid #283c4a;
  border-radius: 10px;
  padding: 10px 12px;
}
.subpanel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  color: #9de5cf;
}
.subtitle-zh {
  margin: 4px 0;
  font-size: 11.5px;
  color: #eaf4f8;
  font-weight: 500;
  line-height: 1.45;
}
.subtitle-en {
  margin: 2px 0 8px;
  font-size: 11px;
  color: #9bb2bf;
  line-height: 1.4;
}
.subpanel-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.subpanel-actions button {
  padding: 5px 9px;
  font-size: 11px;
}
.inline-slider {
  font-size: 11px;
  color: #a7bac5;
  display: flex;
  align-items: center;
  gap: 6px;
}
.inline-slider input[type="range"] {
  width: 85px;
}
.subpanel-meta {
  margin: 6px 0 0;
  font-size: 10.5px;
  color: #7e95a3;
  line-height: 1.4;
}
.controls {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  padding: 8px 16px;
}
button,
.file {
  background: #1c2b34;
  border: 1px solid #37505c;
  color: #e7f2f2;
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
  font:inherit;
  font-size: 12px;
}
button:hover,
.file:hover {
  background: #2a414b;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
.sliders {
  padding: 8px 16px 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 1px solid #24323b;
}
.sliders label,
.replay-scrub-row {
  font-size: 11.5px;
  color: #a7bac5;
  display: flex;
  align-items: center;
  gap: 8px;
}
input[type="range"] {
  accent-color: #55e6c1;
  width: 110px;
}
aside.instructor-rail {
  padding: 16px;
}
.zoe-compact-card {
  background: #15232d;
  border: 1px solid #2b4454;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.zoe-compact-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.zoe-avatar-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #3c6278;
  flex-shrink: 0;
}
.stage-kicker {
  display: block;
  font-size: 13px;
  color: #eaf6ff;
  margin-top: 2px;
}
.zoe-short-prompt {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: #d9eef7;
}
.stage-progress-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: grid;
  gap: 5px;
}
.stage-progress-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #141f27;
  border: 1px solid #22323e;
  font-size: 11.5px;
  color: #93aab8;
  margin: 0;
}
.stage-progress-list li span {
  font-weight: 700;
  color: #6b8899;
  font-size: 11px;
}
.stage-progress-list li.active {
  background: #16333a;
  border-color: #55e6c1;
  color: #eafff8;
  font-weight: 600;
}
.stage-progress-list li.active span {
  color: #55e6c1;
}
.stage-progress-list li.done {
  border-color: #2c5c4f;
  color: #9de5cf;
}
.primary-action-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.primary-stage-btn {
  width: 100%;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  background: #17493f;
  border-color: #55e6c1;
  color: #eafff8;
}
.secondary-stage-btn {
  width: 100%;
  padding: 9px 12px;
  font-size: 12px;
  background: #2b2217;
  border-color: #c28538;
  color: #ffcf91;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-top: 1px solid #293740;
  border-bottom: 1px solid #293740;
  padding: 10px 0;
  margin: 10px 0;
}
.metrics strong {
  display: block;
  font-size: 19px;
  font-weight: 600;
  color: #abe5cf;
}
.metrics span {
  font-size: 10.5px;
  color: #8d9eac;
}
.outcome-card,
.review-box,
.comparison-box,
.rewards-box {
  background: #15222c;
  border: 1px solid #2c4352;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.outcome-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #9bb4c2;
  margin-bottom: 6px;
}
#outcome-headline {
  font-size: 12.5px;
  margin: 4px 0;
  color: #eaf6ff;
}
#outcome-metrics {
  font-size: 11px;
  color: #89dac8;
  margin: 5px 0;
}
.stage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  margin: 6px 0;
  font-size: 10.5px;
}
.stage-item {
  padding: 3px 6px;
  border-radius: 5px;
  background: #101b23;
  color: #9cb3c0;
}
.stage-item.pass {
  color: #89dac8;
  border-left: 3px solid #2e7d67;
}
.stage-item.fail {
  color: #ff8594;
  border-left: 3px solid #9e3a48;
}
.review-text {
  font-size: 11px;
  color: #b2c6ce;
  margin: 5px 0 3px;
}
.review-advice {
  font-size: 11px;
  color: #ffbf79;
  margin: 0;
}
#sensor-quality-card .sq-card-title,
#before-after-loop-card .sq-card-title,
#quest-judge-flow-card .sq-card-title {
  display: block;
  width: 100%;
  font-size: 11.5px;
  font-weight: 600;
  color: #9bb4c2;
  line-height: 1.35;
  margin: 0 0 6px;
}
#outcome-card .sq-status-pills,
#sensor-quality-card .sq-status-pills,
#before-after-loop-card .sq-status-pills,
#quest-judge-flow-card .sq-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  margin-bottom: 6px;
}
#outcome-card .sq-status-pills .pill,
#sensor-quality-card .sq-status-pills .pill,
#before-after-loop-card .sq-status-pills .pill,
#quest-judge-flow-card .sq-status-pills .pill {
  display: inline-block;
  font-size: 10.5px;
  line-height: 1.35;
  padding: 4px 9px;
  border-radius: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}
#sensor-quality-card .sq-primary-action-row,
#quest-judge-flow-card .sq-primary-action-row {
  display: flex;
  margin-top: 6px;
}
#sensor-quality-card #sq-primary-action-btn,
#quest-judge-flow-card #qjf-primary-action-btn {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#sensor-quality-card #sensor-quality-details-fold > summary,
#quest-judge-flow-card #qjf-details-fold > summary {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.35;
  display: flex;
  align-items: center;
}
.loop-metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.loop-metric-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  line-height: 1.35;
  border: 1px solid #2b4555;
  background: #14222c;
  color: #cfe6f2;
}
.loop-metric-chip.improved {
  border-color: #28a778;
  background: #102e24;
  color: #7df5c7;
  font-weight: 600;
}
.loop-metric-chip.regressed {
  border-color: #d94b5a;
  background: #38151a;
  color: #ff9ca6;
  font-weight: 600;
}
.loop-metric-chip.unchanged,
.loop-metric-chip.na {
  border-color: #2f4656;
  background: #15232d;
  color: #a9c0ce;
}
.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  margin-top: 5px;
}
.comp-table th,
.comp-table td {
  padding: 4px 6px;
  border-bottom: 1px solid #223542;
  text-align: left;
}
.comp-table th {
  color: #8aa3b2;
  font-weight: 500;
}
#result,
#revision,
#xr-readout {
  font-size: 11px;
  line-height: 1.5;
  color: #b2c6ce;
  margin: 4px 0;
}
.files {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.file input {
  display: none;
}
.note {
  font-size: 10.5px;
  line-height: 1.5;
  color: #8496a3;
  margin-top: 10px;
}
#message {
  color: #ffc986;
  font-size: 11.5px;
  min-height: 18px;
  margin-top: 6px;
}
.arena-dialog {
  width: min(860px, 94vw);
  background: #111b23;
  color: #e9edf2;
  border: 1px solid #314b5c;
  border-radius: 16px;
  padding: 20px;
}
.arena-dialog::backdrop {
  background: rgba(5, 10, 14, 0.76);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.dialog-head h2 {
  margin: 2px 0 0;
  font-size: 18px;
}
.arena-map-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.arena-map-card {
  background: #15232e;
  border: 1px solid #2a4050;
  border-radius: 12px;
  padding: 12px 14px;
}
.arena-map-card.current {
  border-color: #55e6c1;
  background: #152b30;
}
.arena-map-card.muted {
  opacity: 0.65;
}
.arena-map-card h3 {
  font-size: 13.5px;
  margin: 8px 0 5px;
  color: #eaf6ff;
}
.arena-map-card p {
  font-size: 11.5px;
  color: #9bb2bf;
  margin: 0 0 10px;
  line-height: 1.45;
}
.roadmap-section {
  padding: 12px 14px;
  background: #0e161d;
  border-radius: 12px;
  border: 1px solid #243643;
}
.roadmap-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 10px;
}
.roadmap-card-btn {
  text-align: left;
  padding: 8px 10px;
  background: #14212b;
  border: 1px solid #2b404f;
  border-radius: 8px;
}
.roadmap-card-btn.active {
  border-color: #55e6c1;
  background: #163038;
}
.roadmap-card-btn strong {
  display: block;
  font-size: 11px;
  color: #d8eef5;
  margin-bottom: 2px;
}
.roadmap-card-btn span {
  font-size: 10px;
  color: #8aa2b0;
}
.roadmap-detail {
  background: #13202a;
  border: 1px solid #283c4a;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 11.5px;
  line-height: 1.5;
  color: #bfd2dc;
}
.roadmap-detail ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 11px;
  color: #9bb2bf;
}
footer {
  display: flex;
  justify-content: space-between;
  color: #637985;
  font-size: 10px;
  letter-spacing: 1px;
  margin-top: 14px;
}
@media (max-width: 1024px) {
  body {
    padding: 14px;
  }
  main.arena-first-layout,
  .xr-grid,
  .subpanel-grid,
  .arena-map-grid,
  .roadmap-cards {
    grid-template-columns: 1fr;
  }
}
