/* BPA 360 — 훈련 체험 (training.html)
   창 없이 사건 현장 자체를 직접 분석한다. 마우스는 시선, 클릭은 핀치다. */

/* 부스 화면에서 멀리서도 읽히게 글자를 키운다.
   이 페이지의 글자 크기는 거의 다 rem이라 기준 하나로 함께 커진다 (16px → 18px → 20px).
   가운데 창 자리가 좁은 화면은 덜 키우고, 1000px 아래(작은 태블릿·휴대폰)는 그대로 둔다 */
@media (min-width: 1000px) {
  html {
    font-size: 112.5%;
  }
}

@media (min-width: 1200px) {
  html {
    font-size: 125%;
  }
}

/* 체험이 페이지 전체를 채운다 */
.stage--space {
  padding: 0;
}

/* ---------- 몰입 공간: 화면 전체가 현장이다 ---------- */

.immersive {
  --hud: rgba(30, 23, 18, 0.55);
  --edge: 24px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  container-type: size;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  margin-inline: calc(50% - 50vw);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* 넓은 화면: 안내 창이 왼쪽 가운데를 차지하므로 가운데 창은 그 오른쪽 빈 곳의 가운데에 둔다.
   좁은 화면: 안내 창이 아래를 차지하므로 장면과 창은 그 위에 둔다. */
.immersive {
  --control-w: 370px;
  --control-right: calc(max(var(--edge), var(--rail) + 8px) + var(--control-w) + 16px);
  --reserve: 0px;
}

/* 글자를 키운 만큼 안내 창도 넓힌다 */
@media (min-width: 1000px) {
  .immersive {
    --control-w: 390px;
  }
}

@media (min-width: 1200px) {
  .immersive {
    --control-w: 410px;
  }
}

@media (max-width: 860px) {
  .immersive {
    --reserve: 250px;
  }
}

@media (max-width: 767px) {
  .immersive {
    --reserve: 300px;
  }
}

@media (max-width: 640px) {
  .immersive {
    --edge: 10px;
    --reserve: 290px;
  }
}

/* 위아래 끝은 배경 속으로 흐려 경계를 지운다 */
.immersive__scenes {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(transparent, #000 56px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(transparent, #000 56px, #000 calc(100% - 56px), transparent);
}

.scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  font-family: var(--font);
  touch-action: none;
}

.immersive img {
  -webkit-user-drag: none;
}

/* 벽 장면은 유형 판단부터 훈련 종료까지 같은 벽을 함께 쓴다 */
.wall {
  opacity: 0;
  transition: opacity 700ms ease;
}

.immersive.on-wall .wall {
  opacity: 1;
}

.layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 400ms ease,
    visibility 0s 400ms;
}

.layer.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 500ms ease 150ms;
}

/* 열린 창은 visibility를 다시 visible로 두므로, 꺼진 장면 속 창이 입력을 가로채지 않게 막는다 */
.layer:not(.is-active),
.layer:not(.is-active) * {
  pointer-events: none;
}

/* 방에서 벽으로 갈 때는 B 구역을 향해 걸어 들어가듯 방이 커지며 사라진다 */
.layer--room {
  z-index: 2;
  scale: 2.4;
  transform-origin: var(--focus-x, 20%) var(--focus-y, 35%);
  transition:
    opacity 800ms ease,
    scale 1100ms var(--ease-out),
    visibility 0s 1100ms;
}

.layer--room.is-active {
  scale: 1;
  transition:
    opacity 600ms ease,
    scale 1100ms var(--ease-out);
}

@keyframes arrive {
  from {
    opacity: 0;
    scale: 0.8;
  }
}

.immersive.is-arriving .wall,
.immersive.is-arriving .layer.is-active {
  animation: arrive 1100ms var(--ease-out) both;
}

/* 마우스로 보는 동안에는 화살표 대신 시선 표시만 남긴다 */
.space.is-mouse,
.space.is-mouse * {
  cursor: none;
}

.space.is-mouse textarea {
  cursor: text;
}

/* ---------- 공간 안의 버튼: 바라보면 밝아지고 커진다 ---------- */

.space-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--label);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    scale 260ms var(--ease-out),
    opacity 200ms ease;
}

.space-btn svg {
  flex: none;
  width: 15px;
  height: 15px;
}

.space-btn--icon {
  width: 38px;
  padding: 0;
}

.space-btn.is-gazed {
  background: rgba(255, 255, 255, 0.3);
  scale: 1.06;
}

.space-btn:active {
  scale: 0.96;
}

.space-btn--primary {
  background: rgba(255, 255, 255, 0.9);
  color: #15100c;
}

.space-btn--primary.is-gazed {
  background: #fff;
}

.space-btn:disabled {
  opacity: 0.38;
  scale: 1;
}

.space-btn[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.86);
  color: #15100c;
}

.space-btn[hidden] {
  display: none;
}

/* ---------- 단계 오너먼트 (위) ---------- */

/* left 50%로 두면 폭이 절반으로 줄어 이름이 겹치므로, 양쪽을 잡고 내용 폭으로 가운데 둔다 */
.steps {
  position: absolute;
  z-index: 30;
  top: var(--edge);
  left: var(--edge);
  right: var(--edge);
  display: flex;
  gap: 2px;
  width: fit-content;
  margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.steps::-webkit-scrollbar {
  display: none;
}

.steps li {
  flex: none;
}

.steps button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--label-2);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.steps__num {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--platter);
  color: var(--label);
  font-size: 0.75rem;
  font-weight: 700;
}

.steps button.is-gazed {
  background: rgba(255, 255, 255, 0.14);
}

.steps button[aria-current="step"] {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.steps button.is-done .steps__num {
  background: #5fd38a;
  color: #04210f;
}

@media (max-width: 1280px) {
  .steps button:not([aria-current="step"]) {
    padding-right: 5px;
  }

  .steps button:not([aria-current="step"]) .steps__label {
    display: none;
  }
}

/* 영어 단계 이름은 길어서, 오른쪽 위 언어 전환과 겹치지 않게 더 넓은 화면부터 현재 단계 이름만 보인다 */
@media (max-width: 1680px) {
  .steps:lang(en) button:not([aria-current="step"]) {
    padding-right: 5px;
  }

  .steps:lang(en) button:not([aria-current="step"]) .steps__label {
    display: none;
  }
}

/* ---------- 안내 창 (왼쪽 아래): 앱의 컨트롤 패널 ---------- */

/* 넓은 화면에서는 왼쪽 벽의 B 표지와 바닥의 C 표지 사이에 둔다 */
.control {
  position: absolute;
  z-index: 30;
  left: max(var(--edge), calc(var(--rail) + 8px));
  top: 64%;
  translate: 0 -50%;
  width: min(var(--control-w), calc(100% - var(--edge) * 2));
  padding: 18px 18px 16px;
  border-radius: 32px;
}

.control__step {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--label-3);
}

.control__title {
  margin: 2px 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.control__text {
  margin: 6px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--label-2);
}

.control__meta {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #8ff0b4;
}

.control__meta:empty {
  display: none;
}

.control__tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.control__tasks:empty {
  display: none;
}

.control__tasks li {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--label-2);
}

.control__tasks li.is-current {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.control__tasks li.is-done {
  color: #8ff0b4;
}

.control .segmented {
  margin-top: 12px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
}

.control .segmented[hidden] {
  display: none;
}

.control .segmented button {
  flex: 1;
  min-height: 34px;
  padding: 0 8px;
  font-size: 0.8125rem;
}

.control__hint {
  display: flex;
  gap: 8px;
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
  transition: opacity 180ms ease;
}

.control__hint::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.45em;
  border-radius: 50%;
  background: #5fd38a;
  box-shadow: 0 0 0 3px rgba(95, 211, 138, 0.25);
}

.control__hint:empty {
  display: none;
}

.control__hint.is-changing {
  opacity: 0;
}

.control__actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.control__next {
  margin-left: auto;
}

@media (max-width: 860px) {
  .control {
    top: auto;
    right: var(--edge);
    bottom: var(--edge);
    translate: none;
    width: auto;
  }
}

@media (max-width: 767px) {
  .control {
    bottom: 90px;
  }
}

@media (max-width: 640px) {
  .control {
    padding: 14px 14px 12px;
    border-radius: 26px;
  }

  .control__title {
    font-size: 1.0625rem;
  }

  .control__text {
    display: none;
  }

  .control__hint {
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 0.8125rem;
  }
}

/* 좁은 화면에서 공간 안에 창이 뜨면 안내 창은 짧게 줄인다. 넓은 화면은 처음 보는 사람을 위해 설명을 그대로 둔다 */
@media (max-width: 860px) {
  .immersive:has(.layer.is-active.has-panel) .control__text {
    display: none;
  }
}

/* ---------- 핀치 표시와 시선 ---------- */

.space__pinch {
  position: absolute;
  z-index: 30;
  right: var(--edge);
  bottom: var(--edge);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 7px;
  border-radius: 999px;
  background: var(--hud);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--label-3);
  pointer-events: none;
  transition:
    background-color 100ms ease,
    color 100ms ease,
    scale 160ms var(--ease-out);
}

.space__pinch svg {
  width: 20px;
  height: 20px;
}

.space.is-pinching .space__pinch {
  background: rgba(255, 255, 255, 0.9);
  color: #15100c;
  scale: 0.94;
}

@media (max-width: 640px) {
  .space__pinch {
    display: none;
  }
}

.space__gaze {
  position: absolute;
  z-index: 50;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, 0.7),
    0 2px 10px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px) brightness(1.3);
  -webkit-backdrop-filter: blur(4px) brightness(1.3);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    scale 180ms var(--ease-out);
}

.space.is-looking .space__gaze {
  opacity: 1;
}

/* 바라볼 수 있는 대상 위에서는 대상이 대신 빛난다 */
.space.is-looking.on-target .space__gaze {
  opacity: 0;
  scale: 1.6;
}

.space.is-pinching .space__gaze {
  scale: 0.7;
}

.space__ripple {
  position: absolute;
  z-index: 49;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
  animation: ripple 460ms var(--ease-out) forwards;
}

@keyframes ripple {
  from {
    opacity: 1;
    scale: 0.3;
  }

  to {
    opacity: 0;
    scale: 1.35;
  }
}

/* ---------- 따라 하기 안내 (코치) ----------
   다음에 할 일 바로 옆에 노란 말풍선을 띄우고, 누를 곳에는 고리를, 끌 곳에는 손 모양이 끄는 모습을 보인다.
   노랑은 현장의 증거 표지 색이다. 입력을 가로채지 않는다 */

.coach {
  position: absolute;
  z-index: 45;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.coach.is-on {
  opacity: 1;
}

/* 시연을 보는 동안에는 시연이 대신 보여 준다 */
.space.is-ghost .coach {
  opacity: 0;
}

.coach > * {
  position: absolute;
  left: 0;
  top: 0;
}

.coach [hidden] {
  display: none !important;
}

.coach__ring {
  border-radius: 18px;
  box-shadow:
    0 0 0 2.5px #ffd60a,
    0 0 0 6px rgba(255, 214, 10, 0.28);
  animation: coach-pulse 1.6s ease-in-out infinite;
}

.coach__ring.is-round {
  border-radius: 50%;
}

@keyframes coach-pulse {
  50% {
    box-shadow:
      0 0 0 2.5px #ffd60a,
      0 0 0 14px rgba(255, 214, 10, 0);
  }
}

.coach__box {
  border: 2.5px dashed #ffd60a;
  border-radius: 8px;
  background: rgba(255, 214, 10, 0.1);
}

.coach__goal {
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border: 2.5px dashed #ffd60a;
  border-radius: 50%;
  background: rgba(255, 214, 10, 0.12);
  animation: coach-pulse 1.6s ease-in-out infinite;
}

/* 손 커서와 같은 모양: 흰 고리가 맞대면 조이고 가운데 점이 커진다 */
.coach__hand {
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
}

.coach__hand::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2.5px solid #fff;
  border-radius: 50%;
  box-shadow:
    0 0 0 5px rgba(255, 214, 10, 0.45),
    0 3px 12px rgba(0, 0, 0, 0.45);
  transition: scale 140ms ease;
}

.coach__hand::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: #fff;
  scale: 0.35;
  transition: scale 140ms ease;
}

.coach__hand.is-pressed::before {
  scale: 0.76;
}

.coach__hand.is-pressed::after {
  scale: 1;
}

.coach__bubble {
  --arrow: 50%;
  width: max-content;
  max-width: min(360px, calc(100% - 24px));
  margin: 0;
  padding: 10px 14px;
  border-radius: 16px;
  background: #ffd60a;
  color: #1c1505;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.65);
}

.coach__bubble::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: inherit;
  rotate: 45deg;
}

.coach__bubble[data-side="left"]::after {
  left: -5px;
  top: calc(var(--arrow) - 6px);
}

.coach__bubble[data-side="right"]::after {
  right: -5px;
  top: calc(var(--arrow) - 6px);
}

.coach__bubble[data-side="top"]::after {
  top: -5px;
  left: calc(var(--arrow) - 6px);
}

.coach__bubble[data-side="bottom"]::after {
  bottom: -5px;
  left: calc(var(--arrow) - 6px);
}

@media (max-width: 640px) {
  .coach__bubble {
    max-width: min(240px, calc(100% - 24px));
    padding: 8px 12px;
    font-size: 0.8125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .coach__ring,
  .coach__goal {
    animation: none;
  }
}

/* ---------- 손 (웹캠) ----------
   practice/의 손 커서를 옮겼다: 흰 고리 안의 점이 엄지·검지가 가까워질수록 커지고, 맞대면 고리가 조인다 */

.space__hand {
  position: absolute;
  z-index: 51;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.space__hand::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow:
    0 0 8px rgba(0, 0, 0, 0.4),
    inset 0 0 6px rgba(0, 0, 0, 0.2);
  transition: scale 120ms ease;
}

.space__hand::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  scale: calc(0.25 + var(--amount, 0) * 0.75);
}

.space__hand.is-pinching::before {
  scale: 0.8;
}

.space.is-hand.is-hand-visible .space__hand {
  opacity: 1;
}

/* 바라본 대상이 밝아지면 손 커서는 옅게 남긴다 */
.space.is-hand.on-target .space__hand {
  opacity: 0.55;
}

.space.is-hand .space__gaze {
  display: none;
}

.space.use-hand .by-mouse,
.space:not(.use-hand) .by-hand {
  display: none;
}

/* ---------- 언어 전환 (오른쪽 위): 손 인식 카메라 창이 열리면 그 자리를 내준다 ---------- */

.lang {
  position: absolute;
  z-index: 40;
  top: var(--edge);
  right: var(--edge);
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
}

.space:has(.handcam:not([hidden])) .lang {
  display: none;
}

.lang__item {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--label-2);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 180ms ease,
    color 180ms ease;
}

.lang__item[aria-current="page"] {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.lang__item:not([aria-current]):hover,
.lang__item:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* 좁은 화면에서는 가운데 단계 표시와 겹치지 않게 그 아래로 내리고,
   분석 창이 위쪽까지 차지하므로 첫 화면에서만 보인다(언어를 바꾸면 어차피 처음부터 시작한다) */
@media (max-width: 860px) {
  .lang {
    top: calc(var(--edge) + 56px);
  }

  .space:has(.entry:not(.is-open)) .lang {
    display: none;
  }
}

.handcam {
  position: absolute;
  z-index: 40;
  top: var(--edge);
  right: var(--edge);
  display: grid;
  gap: 8px;
  width: 240px;
  padding: 10px;
  border-radius: 24px;
}

.handcam[hidden] {
  display: none;
}

.handcam__view {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #0d0c0d;
}

.handcam__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.handcam__status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 0.8125rem;
  color: var(--label-2);
  white-space: nowrap;
}

.handcam__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--label-3);
}

.handcam__dot[data-kind="ok"] {
  background: #86e3a8;
  box-shadow: 0 0 10px #86e3a8;
}

.handcam__dot[data-kind="warn"] {
  background: #ffd27a;
}

.handcam__off {
  flex: none;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--label);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
}

.handcam__off.is-gazed {
  background: rgba(255, 255, 255, 0.24);
}

/* 위 단계 막대와 겹치지 않게, 화면이 좁으면 막대 아래로 내린다 */
@media (max-width: 1320px) {
  .handcam {
    top: calc(var(--edge) + 64px);
    width: 200px;
  }
}

/* 창이 뜨면 뒤의 장면을 흐리게 한다 */
.space__dim {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(22, 15, 11, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 320ms ease,
    visibility 0s 320ms;
}

.space__dim.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity 320ms ease;
}

/* 실제 앱 화면 */
.space__shot {
  position: absolute;
  inset: 0;
  z-index: 25;
  margin: 0;
  background: #000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 260ms ease,
    visibility 0s 260ms;
}

.space__shot.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 260ms ease;
}

.space__shot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.space__shot figcaption {
  position: absolute;
  top: calc(var(--edge) + 60px);
  left: 50%;
  translate: -50% 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--hud);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- 공간 안의 창 ---------- */

.panel {
  position: absolute;
  z-index: 15;
  padding: 18px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(92, 76, 65, 0.74), rgba(48, 39, 33, 0.74));
  backdrop-filter: blur(40px) saturate(160%);
  -webkit-backdrop-filter: blur(40px) saturate(160%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 30px 60px -20px rgba(0, 0, 0, 0.6);
  color: var(--label);
  opacity: 0;
  scale: 0.94;
  visibility: hidden;
  transition:
    opacity 240ms ease,
    scale 420ms var(--ease-out),
    visibility 0s 420ms;
}

.panel.is-open {
  opacity: 1;
  scale: 1;
  visibility: visible;
  transition:
    opacity 240ms ease,
    scale 420ms var(--ease-out);
}

.panel.center {
  left: calc((100% + var(--control-right) - var(--edge)) / 2);
  top: 50%;
  translate: -50% -50%;
  max-width: calc(100% - var(--control-right) - var(--edge));
  max-height: calc(100% - 140px);
}

@media (max-width: 860px) {
  .panel.center {
    left: 50%;
    top: 64px;
    translate: -50% 0;
    max-width: calc(100% - 16px);
    max-height: calc(100% - 64px - var(--reserve));
    overflow-y: auto;
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 14px;
    border-radius: 26px;
  }

  .panel.center {
    width: calc(100% - 16px);
  }
}

.panel__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel__sub {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--label-2);
}

.panel__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.panel__actions .space-btn {
  flex: 1;
  min-height: 44px;
  font-size: 0.9375rem;
}

/* ---------- 1 공간 진입 · 2 현장 관찰 ---------- */

/* 방을 화면보다 넓게 두고 시선을 따라 고개를 돌린다 */
/* 위쪽 단계 표시줄 아래에서 시작해 천장 쪽 표지(A, E)가 가려지지 않게 한다 */
.pano {
  --pano-top: 52px;
  --pano-height: calc(100cqh - var(--reserve) - var(--pano-top));
  position: absolute;
  top: var(--pano-top);
  left: 0;
  height: var(--pano-height);
  width: max(100cqw, calc(var(--pano-height) * 2800 / 1172));
  will-change: translate;
}

.pano img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 훈련을 시작하기 전에는 현장이 흐릿하게 보인다 */
.room__veil {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(14, 10, 8, 0.42);
  backdrop-filter: blur(18px) saturate(0.8);
  -webkit-backdrop-filter: blur(18px) saturate(0.8);
  transition:
    opacity 1.4s ease,
    visibility 0s 1.4s;
}

.layer--room.is-entered .room__veil {
  opacity: 0;
  visibility: hidden;
}

.layer--room:not(.is-entered) .spot {
  visibility: hidden;
}

.entry {
  z-index: 6;
  left: 50%;
  top: 46%;
  translate: -50% -50%;
  width: min(400px, calc(100% - 32px));
  padding: 30px 24px 22px;
  border-radius: 40px;
  text-align: center;
}

.entry .logo {
  font-size: 1.4rem;
}

/* #space는 메인 페이지의 .space 그림 카드와 클래스 이름이 같아 `.space svg { width: 100%; height: 100% }`가
   로고 SVG에도 걸린다. 로고는 글자 크기에 맞춘 원래 크기로 되돌린다. */
.entry .logo__symbol {
  width: 1.9em;
  height: auto;
}

.entry .logo__bpa {
  width: auto;
  height: 0.82em;
}

.entry__case {
  display: table;
  margin: 16px auto 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.8125rem;
  font-weight: 600;
}

.entry__lead {
  margin: 12px 0 0;
  font-size: 0.9375rem;
  color: var(--label-2);
}

.inputs {
  display: grid;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.inputs li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.8125rem;
  color: var(--label-2);
}

.inputs b {
  flex: none;
  color: var(--label);
  font-weight: 700;
  white-space: nowrap;
}

.inputs__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: var(--label);
}

.inputs__icon svg {
  width: 17px;
  height: 17px;
}

.entry .space-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  font-size: 1rem;
}

.entry .entry__mouse {
  min-height: 42px;
  margin-top: 10px;
  font-size: 0.875rem;
}

.entry__note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--label-2);
}

.entry__error {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #ffd27a;
}

@media (max-width: 640px) {
  /* 단계 표시와 언어 전환 아래에 둔다 */
  .entry {
    top: 116px;
    translate: -50% 0;
    padding: 20px 16px 16px;
    border-radius: 30px;
  }

  .entry__lead,
  .inputs {
    display: none;
  }
}

.area {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  border-radius: 8px;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.95),
    0 0 32px 8px rgba(255, 255, 255, 0.5),
    0 0 0 200vmax rgba(10, 6, 4, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

.area.is-on {
  opacity: 1;
}

.spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--label);
  font: inherit;
}

.spot::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  box-shadow:
    0 0 0 2.5px rgba(255, 214, 10, 0.95),
    0 0 20px rgba(255, 214, 10, 0.65);
  opacity: 0;
  animation: beckon 2.8s ease-in-out infinite;
}

@keyframes beckon {
  0%,
  100% {
    opacity: 0;
    scale: 0.8;
  }

  50% {
    opacity: 0.85;
    scale: 1.05;
  }
}

.spot.is-gazed::before,
.spot:focus-visible::before {
  animation: none;
  opacity: 1;
  scale: 1.15;
  transition: scale 240ms var(--ease-out);
}

.spot.is-done::after {
  content: "";
  position: absolute;
  right: 8px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #5fd38a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 8.2 2.3 2.3 4.7-5' fill='none' stroke='%2304210f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

.spot__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 4px);
  translate: -50% 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--hud);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    translate 260ms var(--ease-out);
}

.spot--below .spot__label {
  top: calc(100% - 4px);
  bottom: auto;
  translate: -50% -6px;
}

.spot.is-gazed .spot__label,
.spot:focus-visible .spot__label {
  opacity: 1;
  translate: -50% 0;
}

.guide {
  left: 50%;
  top: calc(var(--edge) + 64px);
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(540px, calc(100% - 32px));
  padding: 18px 18px 18px 24px;
}

.guide > div {
  flex: 1;
  min-width: 0;
}

.guide__text {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--label-2);
}

.guide .space-btn {
  min-height: 42px;
  padding: 0 20px;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .guide {
    top: 64px;
    width: calc(100% - 16px);
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }
}

/* ---------- 3 혈흔 유형 판단 ---------- */

.quiz {
  width: min(640px, calc(100% - 24px));
  padding: 22px 22px 14px;
}

.quiz__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.quiz__zone {
  margin-left: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--label-2);
}

.quiz__crumb {
  margin: 0;
  overflow: hidden;
  font-size: 0.8125rem;
  color: var(--label-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.quiz__body {
  transition:
    opacity 160ms ease,
    translate 160ms ease;
}

.quiz.is-turning .quiz__body {
  opacity: 0;
  translate: -12px 0;
}

.quiz__ask {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 16px;
}

.quiz__n {
  margin: 16px 0 0;
  font-size: 1rem;
  font-weight: 600;
}

.quiz__help {
  margin: 8px 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--label-2);
  text-wrap: pretty;
  word-break: keep-all;
}

.quiz__mine {
  display: grid;
  gap: 6px;
  margin: 0;
  text-align: center;
}

.quiz .quiz__thumb {
  display: block;
  width: 168px;
  height: 112px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
  background: #8d7662;
}

.quiz__mine figcaption {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--label-2);
}

.quiz__q {
  margin: 4px 0 0;
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.quiz__opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.opt {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 4px;
  min-height: 118px;
  padding: 16px 18px;
  border: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--label);
  font: inherit;
  text-align: left;
  transition:
    background-color 160ms ease,
    scale 220ms var(--ease-out);
}

.opt__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  justify-self: stretch;
  margin-bottom: 10px;
}

.opt .opt__mark {
  width: 22px;
  height: 22px;
}

.opt .opt__pic {
  width: 120px;
  height: 56px;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.opt b {
  font-size: 1rem;
}

.opt__sub {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--label-2);
  word-break: keep-all;
}

.opt.is-gazed {
  background: rgba(255, 255, 255, 0.2);
  scale: 1.02;
}

.opt:active {
  scale: 0.98;
}

.quiz__stop {
  display: block;
  margin: 12px auto 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--label);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 160ms ease;
}

.quiz__stop.is-gazed {
  background: rgba(255, 255, 255, 0.14);
}

.quiz__stop:disabled {
  color: var(--label-3);
}

@media (max-width: 640px) {
  .quiz {
    padding: 16px 14px 10px;
  }

  .quiz__head {
    flex-direction: column;
    gap: 4px;
  }

  .quiz__n {
    margin-top: 10px;
  }

  .quiz__q {
    font-size: 1.0625rem;
  }

  .quiz__help {
    font-size: 0.8125rem;
  }

  .quiz__opts {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .opt {
    min-height: 0;
    padding: 12px 14px;
  }

  .opt__top {
    margin-bottom: 4px;
  }

  .opt .opt__mark {
    width: 18px;
    height: 18px;
  }

  /* 좁은 화면에서는 그림을 카드 오른쪽에 붙여 카드 높이를 줄인다 */
  .opt {
    position: relative;
    padding-right: 124px;
  }

  .opt .opt__pic {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 96px;
    height: 45px;
    translate: 0 -50%;
  }

  .quiz .quiz__thumb {
    width: 96px;
    height: 72px;
  }
}

/* ---------- 4 방향성 분석 ---------- */

.rep__hit {
  fill: transparent;
}

.rep__ring {
  fill: rgba(95, 211, 138, 0.2);
  stroke: #6fe39a;
  stroke-width: 4;
  transition:
    stroke-width 160ms ease,
    fill 160ms ease;
}

.rep.is-gazed .rep__ring {
  stroke-width: 7;
  fill: rgba(95, 211, 138, 0.38);
}

.rep__label {
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.rep.is-gazed .rep__label {
  opacity: 1;
}

/* 줄 굵기는 벽에서 떨어진 정도에 따라 스크립트가 정한다 */
.string {
  stroke: #fff;
  stroke-linecap: round;
}

.string__shadow {
  stroke: rgba(28, 14, 8, 0.32);
  stroke-linecap: round;
}

/* 벽 앞에 뜬 줄이 벽에 드리운 그림자 */
.string__cast {
  stroke: rgba(28, 14, 8, 0.24);
  stroke-linecap: round;
}

.origin__cast {
  fill: rgba(28, 14, 8, 0.26);
}

/* 공간발혈부위는 벽 앞 공간에 떠 있어서, 돌아간 벽 위에 화면 좌표로 따로 그린다 */
.lift {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  font-family: var(--font);
}

.lift__height {
  stroke: #ff453a;
  stroke-linecap: round;
  stroke-dasharray: 0.1 10;
}

.layer.can-orbit {
  touch-action: none;
  cursor: grab;
}

.layer.can-orbit.is-orbiting {
  cursor: grabbing;
}

.converge__line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 2.5;
  stroke-dasharray: 6 10;
}

.converge__dot {
  fill: rgba(255, 238, 224, 0.95);
  stroke: #fff;
  stroke-width: 3;
}

.origin__dot {
  fill: #ff453a;
  stroke: #fff;
  stroke-width: 4;
}

.measure {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 18px;
  width: min(700px, calc(100% - 32px));
  padding: 14px;
  border-radius: 36px;
}

.measure__view {
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.measure__zoom {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  touch-action: none;
}

.measure__side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 8px 6px 4px 0;
}

.measure__values {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

.measure__values div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.measure__values dt {
  font-size: 0.875rem;
  color: var(--label-2);
}

.measure__values dd {
  min-width: 92px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.measure__values .measure__angle {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.measure__state {
  min-height: 2.9em;
  margin: 12px 0 10px;
  font-size: 0.8125rem;
  color: var(--label-2);
}

.measure.is-matched .measure__state {
  color: #8ff0b4;
  font-weight: 600;
}

.measure__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.measure__foot .space-btn {
  flex: 1;
  min-height: 44px;
  font-size: 0.9rem;
}

.thumbs {
  display: flex;
  gap: 6px;
}

.thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.thumb svg {
  width: 36px;
  height: 36px;
}

.thumb.is-gazed {
  background: rgba(255, 255, 255, 0.16);
}

.thumb[aria-current="true"] {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.thumb__check {
  position: absolute;
  right: -4px;
  top: -4px;
  display: none;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #5fd38a;
  color: #04210f;
}

.thumb__check svg {
  width: 12px;
  height: 12px;
}

.thumb.is-done .thumb__check {
  display: grid;
}

/* 장축은 파랑, 단축은 노랑. 길이가 맞으면 그 축이 초록으로 바뀐다 */
.fit__ellipse {
  fill: rgba(255, 255, 255, 0.06);
  stroke: #fff;
  stroke-width: 2.5;
  stroke-dasharray: 5 6;
}

.fit__axis {
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke 160ms ease;
}

.fit__axis--long,
.fit__handle--long .fit__dot {
  stroke: #5ac8fa;
}

.fit__axis--short,
.fit__handle--short .fit__dot {
  stroke: #ffd60a;
}

.fit__label {
  font-size: 18px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(20, 12, 8, 0.85);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.fit__label--long {
  fill: #5ac8fa;
}

.fit__label--short {
  fill: #ffd60a;
}

.is-long-ok > .fit__axis--long,
.is-long-ok > .fit__handle--long .fit__dot,
.is-short-ok > .fit__axis--short,
.is-short-ok > .fit__handle--short .fit__dot {
  stroke: #5fd38a;
}

.is-long-ok > .fit__label--long,
.is-short-ok > .fit__label--short {
  fill: #5fd38a;
}

.fit__hit {
  fill: transparent;
}

.fit__dot {
  fill: #fff;
  stroke-width: 3;
  transition:
    stroke 160ms ease,
    stroke-width 160ms ease;
}

.fit__handle.is-gazed .fit__dot,
.fit__handle.is-held .fit__dot {
  stroke-width: 6;
}

/* 맞춰서 고정한 축의 손잡이는 더 잡을 수 없다 */
.fit__handle.is-locked {
  pointer-events: none;
}

.fit__handle.is-locked .fit__dot {
  stroke-width: 3;
}

/* 옆 값 칸도 축 색을 따른다 */
.measure__values dt small {
  font-size: 0.75rem;
  color: var(--label-3);
}

.measure__long dt,
.measure__short dt {
  display: flex;
  align-items: center;
  gap: 6px;
}

.measure__long dt::before,
.measure__short dt::before {
  content: "";
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: #5ac8fa;
}

.measure__short dt::before {
  background: #ffd60a;
}

.measure.is-long-ok .measure__long dt::before,
.measure.is-short-ok .measure__short dt::before {
  background: #5fd38a;
}

.measure.is-long-ok .measure__long dd,
.measure.is-short-ok .measure__short dd {
  color: #8ff0b4;
}

.height {
  width: min(540px, calc(100% - 32px));
}

.height__view {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 520 / 290;
  margin-top: 12px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.2);
  touch-action: none;
}

.height__list {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.height__list li {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr) auto;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--label-2);
}

.height__list b {
  color: var(--label);
  font-weight: 700;
}

.height__list span:last-child {
  color: var(--label);
  font-weight: 600;
}

.height__value {
  flex: 1;
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.side__wall {
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 6;
  stroke-linecap: round;
}

.side__axis {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 2;
  stroke-dasharray: 4 6;
}

.side__band {
  stroke: rgba(255, 69, 58, 0.32);
  stroke-width: 18;
  stroke-linecap: round;
}

.side__string {
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 2.5;
}

.side__stain {
  fill: #6fe39a;
}

.side__p {
  fill: rgba(255, 238, 224, 0.95);
}

.side__h {
  stroke: #ff453a;
  stroke-width: 3;
}

.side__dot {
  fill: #ff453a;
  stroke: #fff;
  stroke-width: 3;
  transition: stroke-width 160ms ease;
}


.side__text {
  fill: rgba(255, 255, 255, 0.6);
  font-size: 17px;
  font-weight: 600;
}

/* 이름이 좁아져도 낱말 중간에서 끊지 않는다 */
.measure__values dt {
  overflow-wrap: normal;
}

/* 가운데 자리가 좁으면 확대 화면과 값 칸을 반반으로 나누고, 버튼이 넘치면 아랫줄로 내린다 */
@media (max-width: 1200px) {
  .measure {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .measure__values dd {
    min-width: 76px;
  }

  .measure__foot {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .measure {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .measure__zoom {
    aspect-ratio: 2 / 1;
  }

  .measure__side {
    padding: 0 4px;
  }

  .measure__name,
  .measure__state {
    display: none;
  }

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

  .measure__values div,
  .measure__values .measure__angle {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .measure__values dt {
    font-size: 0.75rem;
  }

  .measure__values dd {
    min-width: 0;
    padding: 4px 8px;
    font-size: 0.8125rem;
    text-align: center;
  }

  .measure__foot {
    margin-top: 8px;
  }

  .thumb {
    width: 40px;
    height: 40px;
  }
}

/* ---------- 5 분석 보고서 작성 · 6 훈련 종료 ---------- */

.report {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  width: min(860px, calc(100% - 24px));
  height: min(600px, calc(100% - 140px));
  padding: 0;
  overflow: hidden;
}

.report__side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 22px 12px 14px;
  background: rgba(0, 0, 0, 0.2);
}

.report__side .panel__title {
  padding: 0 6px;
  font-size: 1.125rem;
}

.report__zone {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  font-size: 0.8125rem;
  font-weight: 600;
}

.report__group {
  margin: 6px 0 0;
  padding: 0 6px;
  font-size: 0.875rem;
  font-weight: 700;
}

.report__nav {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0 0 0 8px;
  list-style: none;
}

.report__tab {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--label);
  font: inherit;
  text-align: left;
  transition: background-color 160ms ease;
}

.report__tab b {
  font-size: 0.875rem;
  font-weight: 600;
}

.report__tab span {
  font-size: 0.6875rem;
  color: #ffbf6b;
}

.report__tab.is-done span {
  color: var(--label-3);
}

.report__tab.is-gazed {
  background: rgba(255, 255, 255, 0.12);
}

.report__tab[aria-current="true"] {
  background: rgba(255, 255, 255, 0.18);
}

.report__done {
  margin-top: auto;
  min-height: 44px;
}

.report__main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 22px 22px 18px;
  overflow-y: auto;
}

.report__crumb {
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.75rem;
  color: var(--label-2);
}

.report__title {
  margin: 16px 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.report__fields {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.report__field {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.report__field--wide {
  grid-template-columns: 1fr;
}

.report__field span {
  padding-top: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--label-2);
}

.report__field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--label);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
  resize: none;
  user-select: text;
  -webkit-user-select: text;
}

.report__field textarea::placeholder {
  color: var(--label-3);
}

.report__field textarea:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 0;
}

.report__records {
  margin-top: auto;
  padding-top: 18px;
}

.report__label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--label-2);
}

.report__records ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.record {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border: 0;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--label);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  transition:
    background-color 160ms ease,
    scale 220ms var(--ease-out);
}

.record svg {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--label-3);
}

.record.is-gazed {
  background: rgba(255, 255, 255, 0.16);
  scale: 1.02;
}

.record:active {
  scale: 0.98;
}

/* 구역 보고서 완료 확인 */
.report__side,
.report__main {
  transition:
    opacity 200ms ease,
    filter 200ms ease;
}

.report.is-confirming .report__side,
.report.is-confirming .report__main {
  opacity: 0.45;
  filter: blur(6px);
  pointer-events: none;
}

.report__confirm {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100% - 32px));
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(104, 88, 76, 0.96), rgba(60, 49, 42, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 30px 60px -20px rgba(0, 0, 0, 0.7);
  text-align: center;
  opacity: 0;
  translate: -50% -50%;
  scale: 0.96;
  visibility: hidden;
  transition:
    opacity 200ms ease,
    scale 320ms var(--ease-out),
    visibility 0s 320ms;
}

.report.is-confirming .report__confirm {
  opacity: 1;
  scale: 1;
  visibility: visible;
  transition:
    opacity 200ms ease,
    scale 320ms var(--ease-out);
}

.report__confirm .panel__sub {
  margin-top: 6px;
  line-height: 1.5;
}

/* 훈련 종료: 실제 앱 화면 세 장으로 '왜 Apple Vision Pro인지' 보여 준다. 글은 한 줄씩만 둔다 */
.finish {
  container: finish / inline-size;
  width: min(920px, calc(100% - 24px));
  padding: 24px 24px 20px;
  overflow-y: auto;
}

.finish__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #5fd38a;
}

.finish__eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.finish__title {
  margin: 0 0 4px;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.finish__lead {
  font-size: 0.875rem;
  line-height: 1.5;
}

.why {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.why__item {
  display: flex;
  flex-direction: column;
  padding: 8px 8px 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.07);
}

.why__shot {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 15px;
  background: #1a1410;
}

.why__shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.why__shot figcaption {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(20, 15, 12, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.6875rem;
  font-weight: 600;
  color: #fff;
}

.why__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 6px 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.why__no {
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--label-3);
}

.why__line {
  margin: 4px 6px 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--label-2);
}

.finish__note {
  margin: 16px 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--label-2);
}

/* 창이 좁으면 사진을 왼쪽에 두고 한 줄에 하나씩 */
@container finish (max-width: 560px) {
  .why {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .why__item {
    display: grid;
    grid-template-columns: 42% 1fr;
    column-gap: 12px;
    align-content: center;
    padding: 8px;
  }

  .why__shot {
    grid-row: span 2;
    aspect-ratio: 4 / 3;
    border-radius: 13px;
  }

  /* 작은 사진에서는 이름표가 화면을 가리므로 뺀다 (위 안내 문구가 실제 앱이라고 알려 준다) */
  .why__shot figcaption {
    display: none;
  }

  .why__head {
    align-self: end;
    margin: 0;
    font-size: 0.9375rem;
  }

  .why__line {
    align-self: start;
    margin: 2px 0 0;
  }
}

@media (max-width: 640px) {
  .finish {
    padding: 20px 14px 16px;
  }
}

@media (max-width: 860px) {
  .report {
    grid-template-columns: 1fr;
    height: auto;
    overflow-y: auto;
  }

  .report__side {
    gap: 6px;
    padding: 14px;
  }

  .report__nav {
    display: flex;
    gap: 6px;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .report__tab {
    flex: none;
    width: auto;
  }

  .report__done {
    margin-top: 4px;
  }

  .report__main {
    padding: 16px 14px;
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .report__field {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .report__field span {
    padding-top: 0;
  }

  /* 아이폰 Safari는 16px 미만 입력칸을 누르면 화면을 멋대로 확대한다 */
  .report__field textarea {
    font-size: 1rem;
  }
}

/* ---------- 접근성 설정 ---------- */

@media (prefers-reduced-motion: reduce) {
  .layer,
  .layer--room,
  .wall,
  .room__veil,
  .panel,
  .space__gaze {
    transition-duration: 1ms;
  }

  .immersive.is-arriving .wall,
  .immersive.is-arriving .layer.is-active,
  .spot::before {
    animation: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .panel,
  .space-btn,
  .space__pinch {
    background: rgb(58, 49, 43);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .room__veil {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(14, 10, 8, 0.8);
  }

  .space-btn--primary {
    background: #fff;
  }
}
