.nu-unit-space .sp-interactive,
.nu-unit-space .sp-static {
  --sp-ink: #2e1065;
  --sp-purple: #7c3aed;
  --sp-soft: #ede9fe;
  --sp-teal: #0f766e;
  border: 1px solid #d8b4fe;
  border-radius: 18px;
  background: linear-gradient(145deg, #faf5ff, #ffffff 62%);
  padding: clamp(12px, 3vw, 20px);
  color: var(--sp-ink);
  overflow: hidden;
}

.nu-unit-space .sp-interactive:focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 3px;
}

.nu-unit-space .sp-shape-compare .sp-stage { display:grid; grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); gap:10px; align-items:start; }
.nu-unit-space .sp-shape-compare .sp-shape-card { display:flex; flex-direction:column; width:100%; gap:6px; padding:8px; border:2px solid transparent; border-radius:12px; text-align:center; box-sizing:border-box; }
.nu-unit-space .sp-shape-compare .sp-shape-card svg { width:100%; max-width:220px; }
.nu-unit-space .sp-shape-compare .sp-shape-card strong { align-self:auto; font-size:1rem; }
.nu-unit-space .sp-shape-compare .sp-shape-card span { font-size:.9rem; }
.nu-unit-space .sp-shape-compare .sp-focused { border-color:#7c3aed; background:#f3e8ff; }
.nu-unit-space .sp-title {
  margin: 0 0 10px;
  font-size: clamp(1rem, 3vw, 1.18rem);
  line-height: 1.3;
  font-weight: 800;
  text-align: center;
}

.nu-unit-space .sp-stage {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.nu-unit-space .sp-shape-card {
  display: grid;
  grid-template-columns: minmax(110px, 180px) minmax(120px, 1fr);
  align-items: center;
  width: min(100%, 520px);
  gap: 12px;
  font-size: 1rem;
}

.nu-unit-space .sp-shape-card svg {
  width: 100%;
  min-width: 0;
}

.nu-unit-space .sp-shape-card strong,
.nu-unit-space .sp-shape-card span {
  grid-column: 2;
}

.nu-unit-space .sp-shape-card strong {
  font-size: 1.12rem;
  align-self: end;
}

.nu-unit-space .sp-shape-card span {
  align-self: start;
}

.nu-unit-space .sp-svg,
.nu-unit-space .sp-composite-svg {
  width: min(100%, 560px);
  height: auto;
  display: block;
  margin: 0 auto;
}

.nu-unit-space svg:not([data-authored]) text {
  font: 700 16px/1.2 ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  fill: #2e1065;
}

.nu-unit-space .sp-fill,
.nu-unit-space .sp-net-face,
.nu-unit-space .sp-tile {
  fill: #c4b5fd;
  stroke: #5b21b6;
  stroke-width: 3;
  stroke-linejoin: round;
}

.nu-unit-space .sp-shine {
  fill: #fff;
  opacity: .55;
}

.nu-unit-space .sp-solid {
  fill: #ddd6fe;
  fill-opacity: .72;
  stroke: #5b21b6;
  stroke-width: 3;
  stroke-linejoin: round;
}

.nu-unit-space .sp-original {
  fill: #99f6e4;
  stroke: #0f766e;
  stroke-width: 3;
  stroke-dasharray: 7 4;
}

.nu-unit-space .sp-fold-copy {
  fill: #fb923c;
  fill-opacity: .48;
  stroke: #c2410c;
  stroke-width: 3;
  stroke-dasharray: 7 4;
}

.nu-unit-space .sp-vertex-mark {
  fill: #ea580c;
  stroke: #fff;
  stroke-width: 2;
}

.nu-unit-space .sp-fold-line {
  fill: none;
  stroke: #4c1d95;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  pointer-events: none;
}

.nu-unit-space .sp-folded path {
  stroke: #5b21b6;
  stroke-width: 3;
  stroke-linejoin: round;
}

.nu-unit-space .sp-overlap-label {
  fill: #991b1b;
  font-size: 16px;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
}

.nu-unit-space .sp-grid line,
.nu-unit-space .sp-coordinate-grid line {
  stroke: #ddd6fe;
  stroke-width: 1.4;
}

.nu-unit-space .sp-main-axis {
  stroke: #4c1d95;
  stroke-width: 2.4;
}

.nu-unit-space .sp-axis-number {
  font-size: 16px;
  font-weight: 750;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
}

.nu-unit-space .sp-grid-labels text {
  font-size: 16px;
  text-anchor: middle;
}

.nu-unit-space .sp-place circle,
.nu-unit-space .sp-coordinate-point circle,
.nu-unit-space .sp-centre {
  fill: #0f766e;
  stroke: #fff;
  stroke-width: 2;
}

.nu-unit-space .sp-square rect {
  fill: rgba(15, 118, 110, 0.35);
  stroke: #0f766e;
  stroke-width: 2;
}

.nu-unit-space .sp-place text,
.nu-unit-space .sp-coordinate-point text {
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.nu-unit-space .sp-route {
  stroke: #ea580c;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 9 6;
  marker-end: url(#sp-arrow);
}

.nu-unit-space .sp-north path {
  fill: none;
  stroke: #4c1d95;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nu-unit-space .sp-point-key {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.nu-unit-space .sp-axis {
  stroke: #ea580c;
  stroke-width: 4;
  stroke-dasharray: 8 5;
}

.nu-unit-space .sp-turn {
  transform-box: fill-box;
  transform-origin: center;
}

.nu-unit-space .sp-part-fold {
  transform-box: fill-box;
  transform-origin: center;
  transform: perspective(400px) rotateX(48deg) rotateZ(-6deg);
}

.nu-unit-space .sp-invalid {
  stroke: #dc2626;
  stroke-width: 8;
  stroke-linecap: round;
}

.nu-unit-space .sp-slice {
  fill: #fb923c;
  fill-opacity: .58;
  stroke: #c2410c;
  stroke-width: 4;
  stroke-dasharray: 7 4;
}

.nu-unit-space .sp-tile:nth-child(even) {
  fill: #99f6e4;
  stroke: #0f766e;
}

.nu-unit-space .sp-step,
.nu-unit-space .sp-caption,
.nu-unit-space .sp-key-help {
  min-height: 1.4em;
  margin: 8px 0 0;
  font-size: .92rem;
  line-height: 1.45;
  text-align: center;
}

.nu-unit-space .sp-step {
  font-weight: 800;
}

.nu-unit-space .sp-key-help {
  color: #5b5567;
}

.nu-unit-space .sp-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.nu-unit-space .sp-controls button {
  min-height: 44px;
  border: 1px solid #7c3aed;
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: #4c1d95;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.nu-unit-space .sp-controls button[data-sp-action="next"] {
  background: #6d28d9;
  color: #fff;
}

.nu-unit-space .sp-controls button:focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 2px;
}

.nu-unit-space .sp-controls button:disabled {
  opacity: .45;
  cursor: default;
}

.nu-unit-space .sp-choice-controls,
.nu-unit-space .sp-direction-pad {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.nu-unit-space .sp-choice-controls button,
.nu-unit-space .sp-direction-pad button,
.nu-unit-space .sp-net-options button {
  min-height: 44px;
  border: 2px solid #7c3aed;
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  color: #4c1d95;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.nu-unit-space .sp-choice-controls button[aria-pressed="true"],
.nu-unit-space .sp-net-options button[aria-pressed="true"] {
  background: #6d28d9;
  color: #fff;
}

.nu-unit-space .sp-route-board {
  width: min(100%, 340px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border: 2px solid #5b21b6;
}

.nu-unit-space .sp-route-cell {
  aspect-ratio: 1;
  position: relative;
  display: grid;
  place-items: start;
  border: 1px solid #c4b5fd;
  background: #fff;
}

.nu-unit-space .sp-route-cell span {
  padding: 3px;
  font-size: 14px;
  font-weight: 800;
}

.nu-unit-space .sp-route-cell.sp-goal::after,
.nu-unit-space .sp-route-cell.sp-current::before {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.nu-unit-space .sp-route-cell.sp-goal::after {
  inset: 26%;
  border: 3px dashed #ea580c;
}

.nu-unit-space .sp-route-cell.sp-current::before {
  inset: 32%;
  background: #0f766e;
  z-index: 1;
}

.nu-unit-space .sp-direction-pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
}

.nu-unit-space .sp-direction-pad button:last-child {
  grid-column: 1 / -1;
}

.nu-unit-space .sp-sym-board {
  width: min(100%, 440px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  position: relative;
}

.nu-unit-space .sp-sym-board > i {
  position: absolute;
  left: calc(50% - 2px);
  top: -4px;
  bottom: -4px;
  width: 4px;
  background: #ea580c;
  pointer-events: none;
}

.nu-unit-space .sp-sym-cell {
  aspect-ratio: 1;
  min-height: 36px;
  border: 1px solid #c4b5fd;
  border-radius: 0;
  background: #fff;
  cursor: pointer;
}

.nu-unit-space .sp-sym-cell:disabled {
  opacity: 1;
  cursor: default;
}

.nu-unit-space .sp-sym-cell.sp-active {
  background: #7c3aed;
  box-shadow: inset 0 0 0 3px #ede9fe;
}

.nu-unit-space .sp-net-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.nu-unit-space .sp-net-options button {
  display: grid;
  justify-items: center;
}

.nu-unit-space .sp-net-options svg {
  width: min(100%, 145px);
}

.nu-unit-space .sp-net-options rect {
  fill: #ddd6fe;
  stroke: #5b21b6;
  stroke-width: 2;
}

.nu-unit-space [hidden] {
  display: none !important;
}

.nu-unit-space.nu-still .sp-part-fold {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .nu-unit-space .sp-part-fold,
  .nu-unit-space .sp-turn {
    transition: none;
  }
}

@media (max-width: 430px) {
  .nu-unit-space .sp-interactive,
  .nu-unit-space .sp-static {
    padding: 12px 8px;
    border-radius: 14px;
  }

  .nu-unit-space .sp-shape-card {
    grid-template-columns: 128px 1fr;
    gap: 8px;
  }

  .nu-unit-space svg:not([data-authored]) text {
    font-size: 17px;
  }

  .nu-unit-space .sp-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .nu-unit-space .sp-controls button {
    min-width: 0;
    padding-inline: 8px;
    font-size: 14px;
  }

  .nu-unit-space .sp-controls button[data-sp-action="reset"] {
    grid-column: 1 / -1;
  }

  .nu-unit-space .sp-step,
  .nu-unit-space .sp-caption,
  .nu-unit-space .sp-key-help,
  .nu-unit-space .sp-shape-card,
  .nu-unit-space .sp-title {
    font-size: 14px;
  }

  .nu-unit-space .sp-direction-pad {
    grid-template-columns: 1fr 1fr;
  }

  .nu-unit-space .sp-net-options {
    grid-template-columns: 1fr;
  }

  .nu-unit-space .sp-net-options button {
    grid-template-columns: 70px 1fr;
    align-items: center;
  }

  .nu-unit-space .sp-net-options svg {
    width: 100px;
  }
}
