/* =========================================================
   폰 목업 (영상통화 / 문자)
   폰 화면(.screen)이 컨테이너라서, 안쪽의 cqw·cqh는 "폰 화면" 기준.
   레퍼런스: 390×844 아이폰 비율, 다크 통화 화면, 하단 반투명 컨트롤 패널
   ========================================================= */
#pstage { position: absolute; inset: 0; z-index: 4; background: #000; }
#pstage[hidden] { display: none; }
#side-info { display: none; }   /* 세로 화면에서는 폰 화면 자체가 전부 */

.dot { width: .6em; height: .6em; border-radius: 50%; background: #34c759; box-shadow: 0 0 .6em #34c759; animation: rec 1.1s ease-in-out infinite; }
.dot.on { animation: none; }
.dot.red { background: #ff3b30; box-shadow: 0 0 .6em #ff3b30; }

/* 안내 문구: 위쪽 가운데 알약 */
#hint {
  position: absolute; z-index: 12; left: 50%; bottom: calc(var(--safe-b) + 104px); transform: translateX(-50%);
  padding: 9px 16px; border-radius: 99em; white-space: nowrap; pointer-events: none;
  font: 700 13px/1 var(--sans); color: #fff; background: rgba(var(--accent-rgb), .22); border: 1px solid rgba(var(--accent-rgb), .6);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: blink 1.6s ease-in-out infinite;
}

/* ---------- 폰 화면 = 전체 화면 ---------- */
#phone { position: absolute; inset: 0; }
#phone.enter { animation: phoneIn .6s cubic-bezier(.2, .9, .25, 1) both; }
@keyframes phoneIn { from { opacity: 0; transform: translateY(6%); } to { opacity: 1; transform: none; } }
/* 받기 → 화면이 앞으로 확 다가오며 전환 */
#phone.zoom { transition: transform .6s cubic-bezier(.6, 0, .4, 1), opacity .45s .15s; transform: scale(1.5); opacity: 0; }
#phone.ringing .bezel { animation: buzz 1.8s infinite; }
@keyframes buzz {
  0%, 28%, 100% { transform: none; }
  2%, 8%, 14%, 20% { transform: translateX(-.6%); }
  5%, 11%, 17%, 23% { transform: translateX(.6%); }
}
.bezel { position: absolute; inset: 0; }
.screen {
  position: relative; width: 100%; height: 100%; overflow: hidden; background: #000;
  container: phone / size; isolation: isolate;
  /* 노치/상태바 영역만큼 위아래 여백 */
  padding-top: var(--safe-t);
}
#pscreen { position: absolute; inset: 0; transition: opacity .2s; }
#pscreen.swap { opacity: 0; }

/* =========================================================
   iOS 스타일 (iPhone 다크 모드 기준)
   ========================================================= */
.screen { font-family: -apple-system, 'SF Pro Text', 'Pretendard Variable', Pretendard, system-ui, sans-serif; }
:root { --ios-blue: #0a84ff; --ios-gray: #262628; --ios-green: #30d158; --ios-red: #ff453a; }

/* ---------- FaceTime 수신 ---------- */
.v-ring {
  position: absolute; inset: 0; overflow: hidden; color: #fff;
  /* 연락처 포스터가 없을 때의 아이폰 기본: 어두운 회색 */
  background:
    radial-gradient(120% 60% at 50% 0%, #4a4a4e, transparent 70%),
    linear-gradient(180deg, #2c2c2e, #1c1c1e 55%, #0b0b0c);
}
.r-poster { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.r-poster span { font: 800 72cqw/1 -apple-system, var(--sans); color: rgba(255,255,255,.07); transform: translateY(-6%); }
/* FaceTime 비디오 수신: 뒤에 내 전면 카메라 화면이 흐리게 비침 */
.r-self { position: absolute; inset: -8%; background: center / cover no-repeat; filter: blur(22px) brightness(.55) saturate(.9); }
.r-head { position: absolute; z-index: 1; left: 0; right: 0; top: calc(var(--safe-t) + 52px); text-align: center; padding: 0 24px; }
.r-kind { display: inline-flex; align-items: center; gap: 6px; font: 500 15px/1 -apple-system, var(--sans); color: rgba(255,255,255,.7); }
.r-kind svg { width: 17px; height: 17px; }
.r-name { margin-top: 10px; font: 600 40px/1.1 -apple-system, var(--sans); letter-spacing: -.01em; }
.r-avatar { position: absolute; left: 50%; top: 44%; width: 120px; height: 120px; transform: translate(-50%, -50%); }
.r-avatar .av, .m-av, .c-av {
  position: relative; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #a5a5ab, #6d6d72);   /* iOS 연락처 이니셜 */
  font: 600 50px/1 -apple-system, var(--sans); color: #fff;
}
.av img, .m-av img, .c-av img { width: 100%; height: 100%; object-fit: cover; }
.r-avatar i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); animation: ripple 2.4s ease-out infinite; }
.r-avatar i:nth-child(2) { animation-delay: 1.2s; }
@keyframes ripple { from { transform: scale(1); opacity: .8; } to { transform: scale(1.8); opacity: 0; } }

.r-extra, .r-btns { position: absolute; z-index: 1; left: 0; right: 0; display: flex; justify-content: space-between; padding: 0 calc(50% - 128px); }
.r-extra { bottom: calc(var(--safe-b) + 210px); }
.r-btns { bottom: calc(var(--safe-b) + 48px); }
.rx, .rb { position: relative; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 500 13px/1 -apple-system, var(--sans); color: #fff; }
.rx b { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.rx svg { width: 20px; height: 20px; }
.rb b { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; transition: transform .12s; }
.rb svg { width: 34px; height: 34px; color: #fff; }
.rb:active b { transform: scale(.92); }
.rb.accept b { background: var(--ios-green); animation: callpulse 1.6s infinite; }
.rb.decline b { background: var(--ios-red); }
.rb.decline svg { transform: rotate(135deg); }
@keyframes callpulse { from { box-shadow: 0 0 0 0 rgba(48,209,88,.55); } to { box-shadow: 0 0 0 18px rgba(48,209,88,0); } }
.r-cta {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translate(-50%, 6px);
  white-space: nowrap; padding: 8px 12px; border-radius: 99em;
  font: 700 13px/1 var(--sans); font-style: normal; color: var(--on-accent); background: var(--accent);
  box-shadow: 0 6px 16px rgba(0,0,0,.35); opacity: 0; transition: opacity .3s, transform .3s;
}
.r-cta::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--accent); }
.r-cta.show { opacity: 1; transform: translate(-50%, 0); animation: ctaBob 1.2s ease-in-out .3s infinite; }
@keyframes ctaBob { 50% { transform: translate(-50%, -6px); } }

/* ---------- FaceTime 통화 중 ---------- */
.v-call { position: absolute; inset: 0; color: #fff; background: #000; animation: fadeIn .35s ease both; }
.v-call .media { position: absolute; inset: 0; }
.v-call .media #video, .v-call .media #ph { position: absolute; inset: 0; width: 100%; height: 100%; }
/* 실제 FaceTime처럼 상대 영상이 화면 전체를 꽉 채움 (남는 부분은 잘림) */
.v-call .media { background: #000; }
.v-call .media #video { object-fit: cover; background: #000; }
.v-call .media-bg { display: none; }
/* 위쪽 반투명 컨트롤 패널 (iOS 17 FaceTime) */
.panel {
  position: absolute; z-index: 3; left: 10px; right: 10px; top: calc(var(--safe-t) + 8px);
  padding: 12px 14px 14px; border-radius: 26px;
  background: rgba(40,40,44,.55); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6);
}
.c-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.c-av { flex: none; width: 36px; height: 36px; font-size: 16px; }
.c-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.c-who b { font: 600 16px/1.15 -apple-system, var(--sans); }
.c-time { display: inline-flex; align-items: center; gap: 5px; font: 500 13px/1 -apple-system, var(--sans); color: rgba(255,255,255,.65); font-variant-numeric: tabular-nums; }
.c-time i { width: 6px; height: 6px; border-radius: 50%; background: var(--ios-green); }
.c-btns { display: flex; justify-content: space-between; }
.pi { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.16); }
.pi svg { width: 22px; height: 22px; }
.pi.hang { background: var(--ios-red); }
.pi.hang svg { transform: rotate(135deg); }
/* 내 화면: 오른쪽 아래 */
.pip {
  position: absolute; z-index: 2; right: 12px; bottom: calc(var(--safe-b) + 24px); width: 27cqw; aspect-ratio: 9 / 16;
  border-radius: 16px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(160deg, #3a3d45, #16171b); box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
.pip svg { width: 45%; color: rgba(255,255,255,.55); }
.pip img { width: 100%; height: 100%; object-fit: cover; filter: blur(3px) brightness(.9); transform: scale(1.2); }
.caption { position: absolute; z-index: 3; left: 16px; right: calc(27cqw + 28px); bottom: calc(var(--safe-b) + 28px); }
.caption span {
  padding: .25em .55em; border-radius: .4em; background: rgba(0,0,0,.62);
  font: 600 16px/1.7 -apple-system, var(--sans); color: #fff;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.caption span:empty { display: none; }
.ended {
  position: absolute; z-index: 5; inset: 0; background: rgba(0,0,0,.6);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  animation: fadeIn .4s both;
}
.ended .c-av { width: 88px; height: 88px; font-size: 36px; margin-bottom: 8px; }
.ended b { font: 600 26px/1.1 -apple-system, var(--sans); }
.ended > span { font: 500 15px/1 -apple-system, var(--sans); color: rgba(255,255,255,.65); }

/* ---------- 잠금화면 + 알림 ---------- */
.v-lock {
  position: absolute; inset: 0; overflow: hidden; color: #fff; cursor: pointer;
  background: #2e2e2e url(../media/images/lock_bg.jpg) center / cover no-repeat;   /* 잠금화면 배경: assets/blur (이미지 뜨기 전에도 비슷한 색이라 까맣게 안 보임) */
}
.l-top { position: absolute; top: calc(var(--safe-t) + 14px); left: 0; right: 0; text-align: center; }
.l-lock svg { width: 18px; height: 18px; opacity: .9; }
.l-date { margin-top: 8px; font: 600 19px/1 -apple-system, var(--sans); color: rgba(255,255,255,.88); }
.l-clock { margin-top: 2px; font: 700 96px/1 -apple-system, 'SF Pro Rounded', var(--sans); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.banner {
  position: absolute; z-index: 4; left: 10px; right: 10px; bottom: calc(var(--safe-b) + 150px);
  display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: 22px;
  background: rgba(50,50,56,.55); -webkit-backdrop-filter: blur(26px) saturate(1.8); backdrop-filter: blur(26px) saturate(1.8);
  color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.2);
  opacity: 0; transform: translateY(20px) scale(.96);
  transition: opacity .35s, transform .55s cubic-bezier(.2, 1.3, .4, 1);
}
.banner.in { opacity: 1; transform: none; }
.banner.top { top: calc(var(--safe-t) + 8px); bottom: auto; z-index: 10; cursor: pointer; transform: translateY(-120%); }
.banner.top.in { transform: none; }
.b-icon { flex: none; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(180deg, #5cf777, #0ec238); }
.b-icon svg { width: 24px; height: 24px; color: #fff; }
.b-body { flex: 1; min-width: 0; }
.b-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.b-row b { font: 600 15px/1.3 -apple-system, var(--sans); }
.b-row span { flex: none; font: 400 13px/1 -apple-system, var(--sans); color: rgba(255,255,255,.55); }
.b-body p {
  margin: 1px 0 0; font: 400 15px/1.3 -apple-system, var(--sans); color: rgba(255,255,255,.92);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.l-bottom { position: absolute; bottom: calc(var(--safe-b) + 34px); left: 44px; right: 44px; display: flex; justify-content: space-between; }
.l-bottom i { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.3); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.l-bottom svg { width: 22px; height: 22px; color: #fff; }
.l-home { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 8px); width: 134px; height: 5px; margin-left: -67px; border-radius: 99em; background: rgba(255,255,255,.85); }

/* ---------- 메시지 (iMessage) ---------- */
.v-chat { position: absolute; inset: 0; background: #000; color: #fff; }
.v-chat.open { animation: chatOpen .4s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes chatOpen { from { opacity: 0; transform: translateX(8%); } to { opacity: 1; transform: none; } }
.m-head {
  position: absolute; z-index: 2; top: 0; left: 0; right: 0;
  padding: calc(var(--safe-t) + 8px) 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: rgba(22,22,24,.82); -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: .5px solid rgba(255,255,255,.12);
}
.m-head .back { position: absolute; left: 8px; top: calc(var(--safe-t) + 16px); color: var(--ios-blue); }
.m-head .back svg { width: 30px; height: 30px; }
.m-head .facetime { position: absolute; right: 16px; top: calc(var(--safe-t) + 20px); color: var(--ios-blue); }
.m-head .facetime svg { width: 26px; height: 26px; }
.m-av { width: 50px; height: 50px; font-size: 21px; }
.m-title { display: flex; align-items: center; gap: 3px; font: 400 12px/1 -apple-system, var(--sans); color: #fff; }
.m-title i { font-style: normal; color: rgba(255,255,255,.4); font-size: 13px; }
.m-scroll {
  position: absolute; top: calc(var(--safe-t) + 92px); bottom: max(calc(var(--safe-b) + 60px), var(--sheet, 0px));
  left: 0; right: 0;
  overflow: hidden; touch-action: none;   /* 브라우저 스크롤 상자 대신 직접 끌어서 스크롤 (X 하단 모듈 방지) */
  transition: bottom .35s cubic-bezier(.2,.8,.2,1);
}
.m-body {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0 12px 8px;   /* 맨 아래에 붙어 위로 쌓임 */
  display: flex; flex-direction: column; gap: 2px;
}
.m-ts { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 10px; font: 400 11px/1.2 -apple-system, var(--sans); color: rgba(255,255,255,.45); }
.m-ts b { font-weight: 600; }
.bub { display: flex; flex-direction: column; max-width: 75%; flex: none; }
.bub.them { align-self: flex-start; margin-left: 4px; }
.bub.me { align-self: flex-end; align-items: flex-end; margin-right: 4px; }
.bub.named { margin-top: 6px; }
.bub small { margin: 0 0 2px 12px; font: 400 11px/1.2 -apple-system, var(--sans); color: rgba(255,255,255,.45); }
.bub span {
  position: relative; z-index: 0; padding: 7px 12px; border-radius: 18px;
  font: 400 17px/1.3 -apple-system, var(--sans); letter-spacing: -.01em; overflow-wrap: anywhere;
}
.bub.them span { background: var(--ios-gray); }
.bub.me span { background: var(--ios-blue); color: #fff; }
/* 말풍선 꼬리: 같은 사람이 연달아 보낸 것 중 마지막에만 */
.bub.them:not(:has(+ .bub.them:not(.named))) span::before,
.bub.me:not(:has(+ .bub.me)) span::before {
  content: ""; position: absolute; z-index: -1; bottom: 0; width: 20px; height: 20px;
}
.bub.them:not(:has(+ .bub.them:not(.named))) span::after,
.bub.me:not(:has(+ .bub.me)) span::after {
  content: ""; position: absolute; z-index: -1; bottom: 0; width: 10px; height: 20px; background: #000;
}
.bub.them span::before { left: -7px; background: var(--ios-gray); border-bottom-right-radius: 16px 14px; }
.bub.them span::after { left: -10px; border-bottom-right-radius: 10px; }
.bub.me span::before { right: -7px; background: var(--ios-blue); border-bottom-left-radius: 16px 14px; }
.bub.me span::after { right: -10px; border-bottom-left-radius: 10px; }
.bub.them:not(:has(+ .bub.them:not(.named))), .bub.me:not(:has(+ .bub.me)) { margin-bottom: 6px; }
.bub.pop { animation: pop .32s cubic-bezier(.2, 1.3, .4, 1) both; transform-origin: bottom left; }
.bub.me.pop { transform-origin: bottom right; animation-name: popMe; }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
@keyframes popMe { from { opacity: 0; transform: translateY(30px) scale(.9); } to { opacity: 1; transform: none; } }
.bub.typing span { display: flex; gap: 4px; padding: 12px 14px; }
.bub.typing i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.45); animation: tdot 1.2s infinite; }
.bub.typing i:nth-child(2) { animation-delay: .15s; }
.bub.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes tdot { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }
.m-recv { align-self: flex-end; margin: -2px 6px 4px 0; font: 600 11px/1 -apple-system, var(--sans); color: rgba(255,255,255,.45); animation: fadeIn .4s .2s both; }

.m-input { position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-b) + 12px); display: flex; align-items: flex-end; gap: 8px; transition: opacity .2s; }
.m-input .plus { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #2c2c2e; color: rgba(255,255,255,.65); }
.m-input .plus svg { width: 18px; height: 18px; }
.m-input .field {
  position: relative; flex: 1; min-height: 34px; display: flex; align-items: center; padding: 6px 40px 6px 13px;
  border-radius: 18px; border: 1px solid #3a3a3c;
  font: 400 17px/1.25 -apple-system, var(--sans);
}
.m-input .ph { color: rgba(255,255,255,.3); }
.m-input .typed:not(:empty)::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; vertical-align: -.17em; background: var(--ios-blue); animation: caret .9s steps(1) infinite; }
.m-input .mic { position: absolute; right: 8px; bottom: 6px; color: rgba(255,255,255,.4); }
.m-input .mic svg { width: 20px; height: 20px; }
.m-input .send { position: absolute; right: 3px; bottom: 3px; width: 28px; height: 28px; border-radius: 50%; display: none; place-items: center; background: var(--ios-blue); }
.m-input .send svg { width: 16px; height: 16px; color: #fff; }
.m-input.active .send { display: grid; }
.m-input.active .mic { display: none; }
.v-chat[style*="--sheet"] .m-input { opacity: 0; }

/* PC 미리보기 창에서만: 아이폰 상태바 흉내 (실제 폰은 진짜 상태바가 있음) */
@media (min-width: 600px) {
  #stage { --safe-t: 44px; --safe-b: 20px; }
}

/* ---------- 폰 장면의 선택지: 아래에서 올라오는 시트 ---------- */
#choices.side {
  left: 0; right: 0; bottom: 0; gap: 9px;
  padding: 26px 16px calc(18px + var(--safe-b));
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.82) 28%, rgba(0,0,0,.92));
  animation: sheetIn .4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes sheetIn { from { transform: translateY(30px); opacity: 0; } }



/* ---------- 사진 메시지 ---------- */
.bub.pic span { padding: 0; background: none !important; border-radius: 18px; overflow: hidden; }
.bub.pic span::before, .bub.pic span::after { display: none; }
.bub.pic img { display: block; width: 58cqw; max-width: 240px; aspect-ratio: 3 / 4; object-fit: cover; }

/* ---------- 전화 앱: 최근 기록 ---------- */
.v-recents { position: absolute; inset: 0; background: #000; color: #fff; padding: calc(var(--safe-t) + 6px) 0 0; }
.rc-top { height: 40px; padding: 0 16px; display: flex; align-items: center; }
.rc-edit { color: var(--ios-blue); font: 400 17px -apple-system, var(--sans); }
.v-recents h1 { margin: 0 16px 10px; font: 700 34px/1.1 -apple-system, var(--sans); letter-spacing: -.01em; }
.rc-seg { margin: 0 16px 8px; display: grid; grid-template-columns: 1fr 1fr; padding: 2px; border-radius: 9px; background: #1c1c1e; font: 600 13px/1 -apple-system, var(--sans); text-align: center; }
.rc-seg b, .rc-seg span { padding: 7px 0; border-radius: 7px; }
.rc-seg b { background: #636366; }
.rc-list { list-style: none; margin: 0; padding: 0 0 0 16px; }
.rc-row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding-right: 14px; border-bottom: .5px solid rgba(255,255,255,.12); cursor: pointer; transition: background .15s; }
.rc-row.tapped { background: rgba(255,255,255,.12); }
.rc-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #a5a5ab, #6d6d72); font: 600 17px/1 -apple-system, var(--sans); }
.rc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rc-main b { font: 600 17px/1.2 -apple-system, var(--sans); }
.rc-main small { display: flex; align-items: center; gap: 4px; font: 400 14px/1 -apple-system, var(--sans); color: rgba(255,255,255,.5); }
.rc-vid svg { width: 14px; height: 14px; display: block; }
.rc-row.missed .rc-main b { color: var(--ios-red); }
.rc-time { font: 400 15px/1 -apple-system, var(--sans); color: rgba(255,255,255,.5); }
.rc-info { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ios-blue); color: var(--ios-blue); display: grid; place-items: center; font: 700 13px/1 Georgia, serif; font-style: italic; }
.rc-tabs { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; padding: 8px 4px calc(var(--safe-b) + 6px); background: rgba(22,22,24,.92); border-top: .5px solid rgba(255,255,255,.12); }
.rc-tabs span { display: flex; flex-direction: column; align-items: center; gap: 3px; font: 500 10px/1 -apple-system, var(--sans); color: rgba(255,255,255,.45); }
.rc-tabs span.on { color: var(--ios-blue); }
.rc-tabs i { font-style: normal; font-size: 22px; line-height: 24px; height: 24px; }
.rc-tabs i svg { width: 24px; height: 24px; }

/* ---------- 전화 거는 중 ---------- */
.v-dial {
  position: absolute; inset: 0; color: #fff;
  background:
    radial-gradient(120% 60% at 50% 0%, #4a4a4e, transparent 70%),
    linear-gradient(180deg, #2c2c2e, #1c1c1e 55%, #0b0b0c);
}
.d-head { position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + 60px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.d-head small { font: 500 15px -apple-system, var(--sans); color: rgba(255,255,255,.6); }
.d-head b { font: 600 38px/1.1 -apple-system, var(--sans); }
.d-status { font: 400 17px -apple-system, var(--sans); color: rgba(255,255,255,.65); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.d-grid { position: absolute; left: 50%; bottom: calc(var(--safe-b) + 70px); transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, 80px); gap: 26px 26px; }
.d-grid span { display: flex; flex-direction: column; align-items: center; gap: 8px; font: 500 13px/1 -apple-system, var(--sans); }
.d-grid b { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); font-size: 28px; font-weight: 400; }
.d-grid b svg { width: 30px; height: 30px; }
.d-grid .end b { background: var(--ios-red); }
.d-grid .end b svg { transform: rotate(135deg); }

/* 전화 앱 장면의 속마음 자막 위치 */
#stage[data-type="dial"] #sub { bottom: calc(var(--safe-b) + 96px); }
#stage.dial-calling #sub { bottom: auto; top: calc(var(--safe-t) + 220px); }

.m-ts.m-date { margin: 14px 0 8px; font-weight: 600; }


/* 음성 메시지 말풍선 */
.bub.vm span { display: flex; align-items: center; gap: 10px; padding: 9px 14px 9px 9px; min-width: 52cqw; }
.vm-play { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); display: grid; place-items: center; cursor: pointer; }
.vm-play i { width: 0; height: 0; margin-left: 3px; border-left: 10px solid #3a3a3c; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.bub.vm.playing .vm-play i { margin: 0; width: 10px; height: 11px; border: 0; border-left: 3px solid #3a3a3c; border-right: 3px solid #3a3a3c; }
.bub.vm.wait .vm-play { animation: vmPulse 1.4s ease-in-out infinite; }
@keyframes vmPulse { 50% { box-shadow: 0 0 0 7px rgba(255,255,255,.22); } }
.vm-wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 26px; }
.vm-wave i { flex: 1; height: calc(var(--h) * 100%); min-height: 3px; border-radius: 2px; background: rgba(255,255,255,.4); }
.vm-wave i.on { background: #fff; }
.vm-dur { font: 500 12px/1 var(--sans); font-style: normal; color: rgba(255,255,255,.75); }

/* 영상 메시지 */
.bub.vid span { position: relative; cursor: pointer; }
.bub.vid img { width: 44cqw; max-width: 200px; aspect-ratio: auto; max-height: 56cqw; object-fit: cover; }
.vid-play { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: rgba(0,0,0,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.vid-play::after { content: ''; position: absolute; left: 17px; top: 13px; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.bub.vid:not(.viewed) span { box-shadow: 0 0 0 2px rgba(var(--accent-rgb), .9); }
.bub.vid.viewed .vid-play { opacity: .55; }
.vviewer { position: absolute; inset: 0; z-index: 30; background: #000; display: grid; place-items: center; animation: vvIn .25s ease both; }
.vviewer.out { animation: vvOut .25s ease both; }
.vviewer video { width: 100%; height: 100%; object-fit: contain; }
.vv-x { position: absolute; top: calc(14px + var(--safe-t, 0px)); right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 16px; }
@keyframes vvIn { from { opacity: 0; transform: scale(.96); } }
@keyframes vvOut { to { opacity: 0; transform: scale(.96); } }
.vviewer.photo img { width: 100%; height: 100%; object-fit: contain; }
.bub.pic:not(.vid) span { cursor: zoom-in; }
#stage.viewing #choices, #stage.viewing #hint { visibility: hidden; }
/* 문자 화면: 안내가 아래쪽 메시지(영상 썸네일 등)를 덮지 않게 대화방 머리 바로 아래로 */
#stage[data-type="chat"] #hint { bottom: auto; top: calc(var(--safe-t) + 104px); }
/* 긴 문장은 줄을 고르게 나눠서 (한 줄만 길고 한 단어만 아래로 떨어지지 않게) */
.bub span, .ur-b span { box-sizing: border-box; }
