/* =========================================================
   기준 화면: iPhone 17 (402 × 874 pt)
   모든 크기·간격은 실제 iPhone 17 스크린샷에서 잰 값(pt = px)입니다.
   화면은 항상 402 × 874 그대로 그린 뒤 통째로 확대/축소합니다.
   ========================================================= */
:root {
  --blue: #3478f6;
  --green: #65c466;
  --red: #ff3b30;
  --label: #000;
  --gray: #8a8a8e;
  --sep: rgba(60, 60, 67, .16);
  --fill: #f2f2f4;

  --W: 402px;
  --H: 874px;
  --nav-top: 61.5px;   /* 상단 버튼 위치 */
  --nav-h: 116px;      /* 상단 바 높이 */

  /* 키패드 */
  --k: 78.7px;
  --kg-x: 23.3px;
  --kg-y: 17.2px;

  /* 하단 탭바 */
  --tab-w: 90.4px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo",
          "Pretendard", "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: #fff;
  color: var(--label);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
.ic { display: inline-flex; }
.ic svg { width: 100%; height: 100%; }

/* ---------- 폰 화면 (항상 402 × 874, 비율 고정 확대/축소) ---------- */
.phone {
  /* 창 한가운데에 고정한 뒤 가운데를 기준으로 확대/축소 */
  position: fixed; left: 50%; top: 50%;
  width: var(--W);
  height: var(--H);
  margin: calc(var(--H) / -2) 0 0 calc(var(--W) / -2);
  overflow: hidden;
  overflow: clip; /* 화면 밖에 대기 중인 상세 화면 쪽으로 밀려 스크롤되지 않게 */
  background: #fff;
  transform: scale(var(--scale, 1));
}

/* PC: 화면 가운데 아이폰 프레임으로 표시 */
@media (min-width: 600px) {
  body { background: radial-gradient(1200px 700px at 50% 0%, #f4f5f9, #dfe1e8); }
  .phone {
    border-radius: 55px;
    box-shadow:
      0 0 0 11px #1c1c1e,
      0 0 0 13px #48484a,
      0 40px 90px rgba(0, 0, 0, .35);
  }
}

/* ---------- 상태바 (PC 폰 프레임에서만 표시, 휴대폰에서는 자리만 차지) ---------- */
.statusbar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 54px;
  padding: 11px 35.5px 0 30px;
  display: none;
  align-items: center;
  justify-content: space-between;
  z-index: 200;
  pointer-events: none;
  font-weight: 600;
  color: #000;
  transition: color .25s;
}
.statusbar.light { color: #fff; }
@media (min-width: 600px) { .statusbar { display: flex; } }
.sb-time { width: 70px; text-align: center; font-size: 17px; letter-spacing: -.2px; }
.island {
  position: absolute; top: 11px; left: 50%;
  width: 125px; height: 37px; margin-left: -62.5px;
  border-radius: 20px; background: #000;
}
.sb-right { display: flex; align-items: center; gap: 7.4px; }
.sb-signal { width: 19.2px; height: 12.7px; fill: currentColor; }
.sb-net { font-size: 14.5px; }
.sb-batt { display: flex; align-items: center; gap: 1px; }
.batt {
  position: relative; width: 26px; height: 13.5px;
  border-radius: 4.5px; overflow: hidden;
  background: rgba(0, 0, 0, .3);
}
.statusbar.light .batt { background: rgba(255, 255, 255, .35); }
.batt i { position: absolute; left: 0; top: 0; bottom: 0; width: 75%; background: currentColor; }
.batt b {
  position: relative; display: grid; place-items: center; height: 100%;
  font-size: 11px; font-weight: 700; color: #fff; letter-spacing: -.3px;
}
.statusbar.light .batt b { color: #000; }
.batt-nub { width: 1.7px; height: 4px; border-radius: 0 1px 1px 0; background: currentColor; opacity: .4; }

/* ---------- 화면 공통 ---------- */
.screens { position: absolute; inset: 0; }
.screen {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .18s, visibility .18s;
}
.screen.active { opacity: 1; visibility: visible; }

.scroll {
  position: absolute; inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-top: var(--nav-h);
  padding-bottom: 104px;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }

/* ---------- 상단 내비게이션 ---------- */
.navbar {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 10;
  height: var(--nav-h);
  padding: var(--nav-top) 15.5px 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  transition: background .2s;
}
.navbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--sep);
  opacity: 0; transition: opacity .2s;
}
.navbar.scrolled {
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
.navbar.scrolled::after { opacity: 1; }
.nav-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: var(--nav-top);
  height: 45px; line-height: 45px;
  font-size: 17px; font-weight: 600; letter-spacing: -.3px;
  white-space: nowrap;
}

/* 리퀴드 글래스 버튼 (밝은 배경) */
.gbtn {
  height: 45px; min-width: 45px;
  border-radius: 22.5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, .09);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .06), inset 0 1px 0 rgba(255, 255, 255, .9);
  font-size: 17px; font-weight: 600;
  transition: transform .15s;
}
.gbtn:active { transform: scale(.94); }
.gbtn.pill { padding: 0 17.5px; min-width: 63.4px; }
.gbtn .ic { width: 24px; height: 24px; }

/* ---------- 아바타 ---------- */
.avatar {
  flex: none;
  width: 45px; height: 45px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #a8b6db 0%, #7480b8 100%);
  background-size: cover; background-position: center;
  color: #fff;
  font-size: 24px; font-weight: 600;
  overflow: hidden;
}
.avatar.unknown svg { width: 100%; height: 100%; }
.avatar.me { width: 40px; height: 40px; background: linear-gradient(180deg, #a6a9b1, #85878f); }
.avatar.lg { width: 48px; height: 48px; font-size: 26px; }
.avatar.xl { width: 120px; height: 120px; font-size: 60px; }

/* ---------- 통화: 즐겨찾기 ---------- */
.fav-row {
  display: flex; gap: 16.6px;
  margin-top: 5.3px;
  padding: 0 16.2px;
  overflow-x: auto; scrollbar-width: none;
}
.fav-row::-webkit-scrollbar { display: none; }
.fav-row:empty { display: none; }
.fav { flex: none; width: 80px; text-align: left; }
.fav-card {
  width: 80px; height: 123px;
  border-radius: 25px;
  background: var(--fill);
  display: grid; place-items: center;
  transition: transform .15s;
}
.fav:active .fav-card { transform: scale(.95); }
.fav-label {
  display: flex; align-items: center; gap: 4px;
  margin-top: 4px; padding-left: 4.8px;
  height: 17px;
  font-size: 14px; color: var(--gray);
  white-space: nowrap;
}
.fav-label .ic { width: 13px; height: 13px; flex: none; }
.fav-label span:last-child { overflow: hidden; text-overflow: ellipsis; }

.section-title {
  margin: 13px 17.5px 8px;
  height: 28px; line-height: 28px;
  font-size: 22px; font-weight: 700; letter-spacing: -.4px;
}

/* ---------- 리스트 행 ---------- */
.row {
  position: relative;
  display: flex; align-items: center; gap: 8.5px;
  height: 75px; padding: 0 16.2px 0 15.7px;
  cursor: pointer;
}
.row::after {
  content: ""; position: absolute; left: 76px; right: 16.2px; bottom: 0;
  height: 1px; background: var(--sep);
}
.row:last-child::after { display: none; }
.row:active { background: rgba(0, 0, 0, .04); }
.row-main { flex: 1; min-width: 0; }
.row-title {
  font-size: 17px; line-height: 21px; font-weight: 600; letter-spacing: -.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-sub {
  display: flex; align-items: center; gap: 4px;
  font-size: 15px; line-height: 19px; color: var(--gray);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-sub .ic { width: 12px; height: 12px; flex: none; }
.row-time { font-size: 15px; color: var(--gray); margin-right: 1px; }
.row-call {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--fill); color: var(--blue);
  display: grid; place-items: center;
}
.row-call .ic { width: 21px; height: 21px; }
.row-call:active { background: #e3e3e8; }
.recent.missed .row-title { color: var(--red); }

/* ---------- 연락처 ---------- */
.mycard {
  display: flex; align-items: center; gap: 10.5px;
  margin-top: 7px;
  height: 56px; padding: 0 17.9px;
}
.mycard-name { font-size: 17px; line-height: 21px; font-weight: 600; letter-spacing: -.3px; }
.mycard-sub { font-size: 15px; line-height: 19px; color: var(--gray); }
.group-head {
  margin: 0 16.2px 0 17.9px;
  padding: 16.5px 2px 10.2px;
  font-size: 15px; line-height: 18px; color: var(--gray);
  border-bottom: 1px solid var(--sep);
}
.row.contact { height: 65px; padding-left: 17.9px; gap: 11px; padding-right: 26px; }
.row.contact::after { left: 73.4px; right: 15.7px; }
.index-bar {
  position: absolute; right: 0; top: 187px;
  width: 15.5px; z-index: 5;
  font-size: 11px; font-weight: 600; color: var(--blue);
  text-align: center;
  touch-action: none; cursor: pointer;
}
.index-bar span { display: block; height: 13.8px; line-height: 13.8px; }
.index-bar span.ko { height: 11.4px; line-height: 11.4px; }

/* ---------- 키패드 ---------- */
.keypad {
  position: absolute; left: 50%; top: 266.5px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, var(--k));
  gap: var(--kg-y) var(--kg-x);
}
.key {
  width: var(--k); height: var(--k);
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 38%, #fff 55%, #f2f2f4 100%);
  border: 1px solid rgba(0, 0, 0, .12);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .035), inset 0 1px 1px rgba(255, 255, 255, .9);
  transition: background .25s;
}
.key.pressed, .key:active { background: #dcdce1; transition: none; }
.kd { font-size: 37.5px; font-weight: 400; line-height: 1; margin-top: -4px; }
.kl {
  font-size: 10px; font-weight: 700; letter-spacing: 2.5px; padding-left: 2.5px;
  line-height: 10px; height: 10px;
}
.k-zero .kl { font-size: 16px; font-weight: 600; letter-spacing: 0; padding: 0; margin-top: 1px; }
.k-star .kd { font-size: 50px; margin-top: 0; transform: translateY(8px); }
.k-hash .kd { font-size: 30px; margin-top: 0; }
.key-call {
  grid-column: 2;
  background: linear-gradient(180deg, #6ccf6f, #5fc161);
  border-color: rgba(70, 180, 80, .6);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), 0 6px 14px rgba(0, 0, 0, .05);
  color: #fff;
}
.key-call.pressed, .key-call:active { background: #4fa752; }
.key-call .ic { width: 40px; height: 40px; }
.key-del {
  background: none; border: 0; box-shadow: none;
  color: #8e8e93;
  visibility: hidden;
}
.key-del:active, .key-del.pressed { background: none; opacity: .5; }
.key-del.show { visibility: visible; }
.key-del .ic { width: 30px; height: 24px; }

.dial-display {
  position: absolute; left: 0; right: 0; top: 168px;
  text-align: center; padding: 0 24px;
}
.dial-number {
  font-size: 36px; font-weight: 400; letter-spacing: .5px;
  min-height: 44px; white-space: nowrap; overflow: hidden; text-overflow: clip;
  direction: ltr;
}
.dial-number.small { font-size: 30px; }
.dial-number.tiny { font-size: 24px; }
.dial-sub { font-size: 17px; color: var(--blue); min-height: 22px; margin-top: 4px; visibility: hidden; }
.dial-sub.show { visibility: visible; }

/* ---------- 하단 탭바 ---------- */
.bottom-bar {
  position: absolute; left: 20.5px; right: 21px;
  bottom: calc(21px + var(--kb, 0px));
  height: 62.5px;
  display: flex; gap: 7.4px;
  z-index: 50;
  transition: bottom .2s;
}
.glass-bar {
  background: rgba(255, 255, 255, .74);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .85);
  transition: background .3s, flex .35s cubic-bezier(.3, .8, .25, 1);
}
.bottom-bar.tinted .glass-bar { background: rgba(196, 194, 255, .78); border-color: rgba(255, 255, 255, .35); }
.tabs {
  position: relative; flex: 1 1 0;
  border-radius: 31.25px;
  display: flex; padding: 0 8.7px; /* 테두리 1px 포함 → 탭 안쪽 여백 9.7 */
}
.tab {
  position: relative; z-index: 1; flex: 0 0 var(--tab-w);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; line-height: 12px; font-weight: 600; color: #000;
  transition: color .25s;
}
.tab .ic { width: 25px; height: 25px; }
.tab.active { color: var(--blue); }
.tab-indicator {
  position: absolute; top: 3.25px; left: 3.65px;
  width: 100.5px; height: 54px;
  border-radius: 27px;
  background: rgba(0, 0, 0, .075);
  transition: transform .38s cubic-bezier(.3, .8, .25, 1);
}
.bottom-bar.tinted .tab-indicator { background: rgba(255, 255, 255, .3); }

.search-btn {
  flex: 0 0 62.5px; height: 62.5px;
  border-radius: 31.25px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 17.75px;
  overflow: hidden; cursor: pointer;
}
.search-btn .s-icon { width: 27px; height: 27px; flex: none; }
.bottom-bar.tinted .search-btn .s-icon { color: var(--blue); }
.search-btn input {
  display: none; flex: 1; min-width: 0;
  border: 0; outline: none; background: none;
  font: inherit; font-size: 17px; color: #000;
  -webkit-user-select: text; user-select: text;
}
.search-btn input::-webkit-search-cancel-button { display: none; }
.s-clear {
  display: none; flex: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #b4b4b9; color: #fff;
  font-size: 15px; line-height: 20px; text-align: center;
}

/* 검색 모드: 탭바가 원형으로 줄고 검색창이 늘어남 */
.bottom-bar.searching .tabs { flex: 0 0 62.5px; padding: 0; }
.bottom-bar.searching .tab { flex: 1; }
.bottom-bar.searching .tab:not(.active),
.bottom-bar.searching .tab-label,
.bottom-bar.searching .tab-indicator { display: none; }
.bottom-bar.searching .tab.active { color: #000; }
.bottom-bar.searching .search-btn { flex: 1 1 auto; justify-content: flex-start; cursor: text; }
.bottom-bar.searching .s-icon { width: 20px; height: 20px; color: var(--gray); }
.bottom-bar.searching input { display: block; }
.bottom-bar.searching .s-clear.show { display: block; }

.search-hint { padding: 40px 24px; text-align: center; color: var(--gray); font-size: 16px; }

/* ---------- 연락처 상세 ---------- */
.detail {
  position: absolute; inset: 0; z-index: 30;
  color: #fff;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.3, .8, .25, 1);
  background: #8892b5;
}
.detail.open { transform: none; }
.dnav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  padding: var(--nav-top) 15.5px 0;
  display: flex; justify-content: space-between;
}
.dglass {
  height: 45px; min-width: 45px; border-radius: 22.5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(70, 80, 115, .42);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15);
  font-size: 17px; font-weight: 600; color: #fff;
}
.dglass.pill { padding: 0 17.5px; min-width: 63.4px; }
.dglass .ic { width: 24px; height: 24px; }
.dscroll { padding: 147.9px 16px 104px; }
.d-avatar {
  width: 242.5px; height: 242.5px; margin: 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 25%, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 70%);
  background-size: cover; background-position: center;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, .55),
    inset 0 3px 8px rgba(255, 255, 255, .35),
    inset 0 -3px 10px rgba(255, 255, 255, .15),
    0 12px 30px rgba(0, 0, 0, .06);
  font-size: 124px; font-weight: 600; color: #f2f2f7;
  overflow: hidden;
}
.d-avatar svg { width: 100%; height: 100%; }
.d-badge {
  display: table; margin: 17.7px auto 0;
  height: 25.4px; line-height: 25.4px; padding: 0 13.5px;
  border-radius: 12.7px;
  background: #7c5884;
  font-size: 13px; font-weight: 600;
}
.d-name {
  margin-top: 4.7px; text-align: center;
  font-size: 24px; line-height: 29px; font-weight: 700; letter-spacing: -.4px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}
.d-company { text-align: center; font-size: 16px; opacity: .8; margin-top: 2px; }
.d-actions { display: flex; justify-content: center; gap: 8px; margin-top: 13.9px; }
.d-act {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(40, 50, 110, .32);
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  color: #fff;
}
.d-act .ic { width: 28px; height: 28px; }
.d-act.disabled { color: rgba(255, 255, 255, .35); }
.d-act:active { background: rgba(40, 50, 110, .5); }
.d-card {
  margin-top: 6.1px;
  border-radius: 22px;
  background: rgba(118, 128, 230, .42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 13.5px 16.5px;
}
.d-card.first { margin-top: 20.1px; }
.d-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.d-label { font-size: 17px; line-height: 21px; display: flex; align-items: center; gap: 6px; }
.d-label .ic { width: 17px; height: 17px; }
.d-value { font-size: 17px; line-height: 21px; letter-spacing: .2px; word-break: break-all; }
.d-line > button .ic { width: 16px; height: 16px; }
.d-memo { min-height: 108px; padding-top: 14px; }
.d-memo-text { font-size: 17px; margin-top: 6px; white-space: pre-wrap; opacity: .95; }
.d-list { padding: 0 16.5px; }
.d-list button {
  display: block; width: 100%; text-align: left;
  height: 52px; font-size: 17px;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
}
.d-list button:last-child { border-bottom: 0; }
.d-list .danger { color: #ffb4b4; }

/* ---------- 메시지 (가상 대화) ---------- */
.msg {
  position: absolute; inset: 0; z-index: 60;
  background: #fff;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.3, .8, .25, 1);
  --me: #0b84ff;
  --them: #e9e9eb;
}
.msg.open { transform: none; }
.m-scroll {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 150px 16px calc(96px + var(--kb, 0px));
  scrollbar-width: none;
}
.m-scroll::-webkit-scrollbar { display: none; }
.m-nav {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  height: 146px;
  padding: var(--nav-top) 15.5px 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  background: linear-gradient(180deg, #fff 72%, rgba(255, 255, 255, 0));
}
.m-who {
  position: absolute; left: 50%; top: 54px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.avatar.m { width: 50px; height: 50px; font-size: 24px; }
.m-name {
  padding: 3px 10px; border-radius: 12px;
  font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap;
  background: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, .08);
}
.m-time { margin: 14px 0 6px; text-align: center; font-size: 12px; line-height: 16px; color: var(--gray); }
.m-row { display: flex; margin-top: 8px; }
.m-row.cont { margin-top: 2px; }
.m-row.me { justify-content: flex-end; }
.m-bubble {
  position: relative;
  max-width: 75%;
  padding: 7px 13px;
  border-radius: 18px;
  font-size: 17px; line-height: 22px;
  white-space: pre-wrap; word-break: break-word;
  -webkit-user-select: text; user-select: text;
}
.me .m-bubble { background: var(--me); color: #fff; }
.them .m-bubble { background: var(--them); color: #000; }
/* 말풍선 꼬리 */
.m-bubble.tail::before, .m-bubble.tail::after { content: ""; position: absolute; bottom: 0; height: 17px; }
.me .m-bubble.tail::before { right: -7px; width: 20px; background: var(--me); border-bottom-left-radius: 16px 14px; }
.me .m-bubble.tail::after { right: -26px; width: 26px; background: #fff; border-bottom-left-radius: 10px; }
.them .m-bubble.tail::before { left: -7px; width: 20px; background: var(--them); border-bottom-right-radius: 16px 14px; }
.them .m-bubble.tail::after { left: -26px; width: 26px; background: #fff; border-bottom-right-radius: 10px; }
.m-read { margin-top: 3px; padding-right: 4px; text-align: right; font-size: 11px; line-height: 14px; color: var(--gray); }
.m-input {
  position: absolute; left: 15.5px; right: 15.5px; bottom: calc(21px + var(--kb, 0px)); z-index: 2;
  display: flex; gap: 8px;
  transition: bottom .2s;
}
.m-field {
  flex: 1; height: 45px;
  display: flex; align-items: center; gap: 6px;
  padding: 0 6px 0 16px;
  border-radius: 22.5px;
  background: rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, .12);
}
.m-field input {
  flex: 1; min-width: 0;
  border: 0; outline: none; background: none;
  font: inherit; font-size: 17px; color: #000;
  -webkit-user-select: text; user-select: text;
}
.m-field input::placeholder { color: #b4b4b9; }
.m-mic { display: inline-flex; padding-right: 6px; }
.m-mic .ic { width: 22px; height: 22px; color: #8e8e93; }
.m-send {
  display: none; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  place-items: center;
  background: var(--me); color: #fff;
}
.m-send .ic { width: 18px; height: 18px; }
.m-field.has-text .m-mic { display: none; }
.m-field.has-text .m-send { display: grid; }
/* 상대가 입력 중… */
.m-typing { display: flex; gap: 4px; align-items: center; height: 36px; padding: 0 14px; }
.m-typing i { width: 8px; height: 8px; border-radius: 50%; background: #8e8e93; animation: m-dot 1.2s infinite ease-in-out; }
.m-typing i:nth-child(2) { animation-delay: .2s; }
.m-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes m-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }

/* ---------- 통화 화면 ---------- */
.call {
  position: absolute; inset: 0; z-index: 100;
  background: linear-gradient(180deg, #5e6782, #22243a);
  color: #fff;
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.call.open { opacity: 1; visibility: visible; }
.call-top { position: absolute; left: 0; right: 0; top: 108px; padding: 0 24px; text-align: center; }
.call-status { font-size: 17px; line-height: 22px; opacity: .75; font-variant-numeric: tabular-nums; }
.call-name {
  margin-top: 4px;
  font-size: 34px; line-height: 41px; font-weight: 500; letter-spacing: -.4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 버튼 6개: 키패드와 같은 열 위치, 종료 버튼은 키패드 통화 버튼과 같은 자리 */
.call-buttons {
  position: absolute; left: 50%; top: 533.4px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, var(--k));
  gap: 17px var(--kg-x);
}
.cbtn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; line-height: 15px; font-weight: 500; color: #fff;
  transition: opacity .2s;
}
.cbtn .ic {
  width: var(--k); height: var(--k); padding: 23px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .12);
  transition: background .2s, color .2s;
}
.cbtn:active .ic { background: rgba(255, 255, 255, .3); }
.cbtn.on .ic { background: #fff; color: #1c1c1e; }
.cbtn.end .ic { background: var(--red); border-color: transparent; }
.cbtn.end .ic svg { transform: rotate(135deg); }
.cbtn.end:active .ic { background: #d9322a; }
.cbtn.accept .ic { background: var(--green); border-color: transparent; }
.cbtn.accept:active .ic { background: #4fa752; }
.call.ended .cbtn { opacity: .4; pointer-events: none; }

/* ---------- 영상통화 (FaceTime) ---------- */
.vc {
  position: absolute; inset: 0; z-index: 100;
  overflow: hidden;
  background: #1c1c1e; color: #fff;
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.vc.open { opacity: 1; visibility: visible; }
/* 카메라가 없을 때 보이는 배경 */
.vc-bg {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #3a3f52, #15161d);
}
.vc video { position: absolute; object-fit: cover; background: #000; }
.vc-remote { top: 0; left: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; transition: opacity .3s; }
.vc.connected .vc-remote { opacity: 1; }
/* 내 화면: 연결 중엔 전체 화면, 연결되면 오른쪽 아래 작은 창 */
.vc-self {
  z-index: 2;
  top: 0; left: 0; width: 402px; height: 874px;
  border-radius: 0;
  transform: scaleX(-1);
  opacity: 0;
  transition: top .45s, left .45s, width .45s, height .45s, border-radius .45s, opacity .3s;
  transition-timing-function: cubic-bezier(.3, .8, .25, 1);
}
.vc.has-cam .vc-self { opacity: 1; }
.vc.connected .vc-self {
  top: 666px; left: 274px; width: 112px; height: 168px;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.vc-panel {
  position: absolute; top: 54px; left: 12px; right: 12px; z-index: 3;
  padding: 14px 16px 16px;
  border-radius: 34px;
  background: rgba(40, 40, 46, .55);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .12);
}
.vc-who { display: flex; align-items: center; gap: 10px; }
.avatar.vc-av { width: 40px; height: 40px; font-size: 18px; }
.vc-text { min-width: 0; }
.vc-name { font-size: 17px; line-height: 21px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-status { font-size: 13px; line-height: 17px; opacity: .75; font-variant-numeric: tabular-nums; }
.vc-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; transition: opacity .2s; }
.vbtn {
  height: 52px; border-radius: 26px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  transition: background .2s, color .2s;
}
.vbtn .ic { width: 24px; height: 24px; }
.vbtn:active { background: rgba(255, 255, 255, .3); }
.vbtn.on { background: #fff; color: #1c1c1e; }
.vbtn.end { background: var(--red); }
.vbtn.end .ic svg { transform: rotate(135deg); }
.vc.ended .vc-btns { opacity: .4; pointer-events: none; }

/* 수신 영상통화: 수락·거절 버튼 */
.vc-incoming-buttons {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  width: 100% !important;
  margin-top: 18px !important;
}
.vc-incoming-buttons > span { display: none !important; }
.vc-incoming-buttons .cbtn { flex: 0 0 auto; min-width: 0; font-size: 11px; gap: 5px; }
.vc-incoming-buttons .cbtn .ic { width: 56px; height: 56px; padding: 16px; }

/* 통화 종료 화면에서는 버튼 흐리게 */
.vc.ended .vc-incoming-buttons { opacity: .4; pointer-events: none; }

/* ---------- 토스트 ---------- */
.toast {
  position: absolute; left: 50%; z-index: 150;
  top: 124px;
  transform: translate(-50%, -8px);
  padding: 10px 16px; border-radius: 20px;
  background: rgba(30, 30, 32, .88); color: #fff;
  font-size: 14px; white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
