/* 통증 클리닉 첫 쪽 3D 몸 판(2026-10-19 원장 「자생 꼴을 똑같이 따라하라」). 자생한방병원 「진료분야」 판의 짜임 · 크기를 따른다
   (숫자는 그 판을 1440 · 768 · 390 폭에서 잰 값. 잰 기록은 본사 강실장자료/작업창/도구-홈페이지-통증3D자생꼴-20261019/자생관찰.md).
   틀은 pain.mjs 의 pain3dPanel, 움직임은 pain-3d.js. 판은 hidden 으로 찍히고 3D 를 그릴 수 있을 때만 스크립트가 연다(그때 body 에 pm3-live).
   그때는 위 2D 몸 그림과 물음 한 줄을 숨긴다. 스크립트가 없거나 3D 를 못 그리면 이 파일의 규칙은 아무것도 바꾸지 않는다.
   색은 사이트 짙은 초록 하나다(원장 10-19 「9ㄱ」 가 초록. 파랑 갈래는 걷었다). 몸 색도 여기서 읽는다(--pm3-body-*).
   판은 옅은 미색 초록, 몸은 상아색 무광 도자기다(원장 10-19 「3번 ㄴ」 · 갈래 나). 판이 옅으므로 판 위 글 · 탭 · 바탕 줄은 짙은 초록. */

.pm3[hidden] { display: none !important; }
.pm3-live .pm-image-panel,
.pm3-live .pm-top .pm-ask { display: none; }

.pm3 {
  --pm3-bg: #e6ece4;
  --pm3-tab-on: #193c32;
  --pm3-dot: #19cfd0;
  --pm3-dot-halo: rgba(25, 207, 208, 0.2);
  --pm3-head-kicker: #31584a;
  --pm3-head-title: #193c32;
  --pm3-guide-i: #31584a;
  --pm3-body-center: #fbf6ec; /* 몸 가운데(빛을 바로 받는 쪽) */
  --pm3-body-edge: #a39a8a; /* 몸 가장자리(실루엣 쪽이 더 짙다) */
  --pm3-shirt-center: #ffffff; /* 셔츠(원장 10-25 「흰 상의」) */
  --pm3-shirt-edge: #b4b6b2;
  --pm3-shorts-center: #31584a; /* 반바지(「초록바지」. 사이트 초록 --color-primary) */
  --pm3-shorts-edge: #193c32; /* 사이트 짙은 초록 --color-primary-dark */
  position: relative;
  width: 100%;
  max-width: 960px;
}

/* 색 판 */
.pm3-panel {
  --pm3-anchor: 0.5; /* 고른 부위의 점이 서는 세로 자리(판 높이에 대한 몫). 카드는 그 아래 */
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: 734px;
  border-radius: 40px;
  background: var(--pm3-bg);
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

/* 머리말: 넓은 화면은 판 안 왼쪽 위(짙은 글) */
.pm3-head {
  position: absolute;
  z-index: 10;
  top: 40px;
  left: 40px;
  pointer-events: none;
  color: var(--pm3-head-title);
}
.pm3-kicker { margin: 0; color: var(--pm3-head-kicker); font-size: 1.25rem; font-weight: 700; line-height: 1.6; letter-spacing: -0.02em; }
.pm3-title { margin: 0; color: inherit; font-size: 2rem; font-weight: 700; line-height: 1.5; letter-spacing: -0.03em; }
/* 안내 한 줄: 넓은 화면은 판 오른쪽 위(큰 제목과 아래선을 맞춤), 휴대폰은 판 맨 아래 가운데 */
.pm3-guide {
  position: absolute;
  z-index: 10;
  top: 90px;
  right: 40px;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: rgba(25, 60, 50, 0.8);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -0.02em;
  pointer-events: none;
}
.pm3-i { width: 20px; height: 20px; flex: none; color: rgba(25, 60, 50, 0.8); }

/* 탭 줄 */
.pm3-tabs {
  position: absolute;
  z-index: 10;
  top: 190px;
  left: 50%;
  width: min(550px, calc(100% - 40px));
  transform: translateX(-50%);
  display: flex;
  justify-content: space-around;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.pm3-tabs::-webkit-scrollbar { display: none; }
.pm3-tab {
  flex: none;
  min-width: 70px;
  height: 70px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #31584a;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  cursor: pointer;
}
.pm3-tab span { position: relative; display: inline-block; margin-top: -5px; }
.pm3-tab span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 6px; height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--pm3-dot);
  opacity: 0;
}
.pm3-tab[aria-selected="true"] { background: var(--pm3-tab-on); color: #fff; }
.pm3-tab[aria-selected="true"] span::after { opacity: 1; }
.pm3-tab:focus-visible { outline: 3px solid var(--pm3-tab-on); outline-offset: -3px; }
.pm3-tab[aria-selected="true"]:focus-visible { outline-color: #fff; }

/* 3D 그림 · 바탕 세로 줄(움직이지 않는 그림) */
.pm3-stage { position: absolute; inset: 0; z-index: 1; opacity: 0; transition: opacity 0.6s ease; }
.pm3-stage.is-on { opacity: 1; }
.pm3-stage canvas { display: block; width: 100%; height: 100%; }
.pm3-waves { position: absolute; z-index: 0; left: -10%; width: 120%; top: 45%; height: 40.2%; opacity: 0.08; pointer-events: none; }
.pm3-waves i {
  position: absolute;
  width: 3.5px;
  border-radius: 2px;
  background: linear-gradient(to bottom, rgba(25, 60, 50, 0.45), #193c32 28%, #193c32 72%, rgba(25, 60, 50, 0.42));
}

/* 점: 흰 점 · 청록 동그라미 · 옅은 청록 둘레 세 겹(깜빡이지 않는다) */
.pm3-dot {
  position: absolute;
  z-index: 4;
  left: 0; top: 0;
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 3.7px, var(--pm3-dot) 4.2px 12.4px, var(--pm3-dot-halo) 12.9px 27.9px, transparent 28.4px);
  pointer-events: none;
  opacity: 0;
}
.pm3-dot.is-on { opacity: 1; }

/* 말풍선 카드: 점 바로 밑에 서고 카드 폭의 27% 만큼 왼쪽으로 치우친다. 꼬리는 카드 위 가운데 */
.pm3-card {
  position: absolute;
  z-index: 5;
  left: 0; top: 0;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 15px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(25, 60, 50, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.pm3-card[hidden] { display: none; }
.pm3-card.is-on { opacity: 1; pointer-events: auto; }
.pm3-card::before {
  content: "";
  position: absolute;
  top: -11px;
  left: var(--tail, 50%);
  border-right: 12px solid transparent;
  border-bottom: 12px solid #fff;
}
.pm3-card ul { margin: 0; padding: 0; list-style: none; }
.pm3-card li + li, .pm3-card ul + .pm3-all { border-top: 1px solid #edeef5; }
.pm3-card a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 10px 0;
  color: #262f40;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.pm3-card .pm3-all { color: var(--pm3-head-kicker); }
.pm3-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #f3f4f8;
  color: #7a8390;
}
.pm3-go svg { width: 14px; height: 14px; }
.pm3-card a:focus-visible { outline: 2px solid var(--pm3-tab-on); outline-offset: 2px; border-radius: 6px; }

/* 768 ~ 1023: 판 800 높이, 머리말 · 탭 글을 줄인다 */
@media (max-width: 1023.98px) {
  .pm3-panel { height: 800px; }
  .pm3-kicker { font-size: 1rem; }
  .pm3-title { font-size: 1.875rem; }
  .pm3-guide { font-size: 1rem; }
  .pm3-i { width: 16px; height: 16px; }
  .pm3-tab { min-width: 60px; height: 60px; padding: 0 12px; font-size: 1.0625rem; }
  .pm3-tab span::after { bottom: -11px; }
}

/* 휴대폰: 머리말은 판 위(흰 바탕 위 짙은 글), 판은 폭의 1.8배 높이, 탭은 왼쪽부터 15px 사이로 붙이고 고른 탭만 크다, 안내는 판 맨 아래 가운데 */
@media (max-width: 767.98px) {
  .pm3 { max-width: none; }
  .pm3-head { position: static; margin: 0 0 25px; color: var(--pm3-head-title); }
  .pm3-kicker { font-size: 1.0625rem; font-weight: 600; color: var(--pm3-head-kicker); }
  .pm3-title { font-size: 1.875rem; line-height: 1.4; }
  .pm3-panel { --pm3-anchor: 0.46; height: auto; aspect-ratio: 10 / 18; border-radius: 15px; }
  .pm3-guide { top: auto; right: 0; left: 0; bottom: 20px; justify-content: center; font-size: 0.875rem; font-weight: 600; }
  .pm3-i { width: 14px; height: 14px; }
  .pm3-tabs { top: 27px; left: 0; width: 100%; transform: none; justify-content: flex-start; align-items: center; gap: 15px; height: 63px; padding: 0 15px; }
  .pm3-tab { min-width: 51px; height: 51px; padding: 0 10px; font-size: 1.0625rem; }
  .pm3-tab[aria-selected="true"] { min-width: 63px; height: 63px; font-size: 1.3125rem; }
  .pm3-tab span::after { bottom: -10px; }
  .pm3-waves { top: 40%; height: 26%; }
  .pm3-card { padding: 5px 15px; border-radius: 15px; }
  .pm3-card a { gap: 20px; font-size: 1rem; white-space: normal; word-break: keep-all; }
  .pm3-go { width: 29px; height: 29px; }
}
@media (min-width: 600px) and (max-width: 767.98px) {
  .pm3-panel { aspect-ratio: 10 / 11; }
}
