/* ───────── 이름 입력 화면 ───────── */
.setup {
  z-index: 60; background: #000; color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  overflow-y: auto;
  transition: opacity .6s ease;
}
.setup.leaving { opacity: 0; pointer-events: none; }
.setup-inner { padding: calc(var(--sb-h) + var(--safe-top) + 20px) 28px 40px; }
.setup-kicker { font-size: 13px; color: #8e8e93; font-weight: 600; letter-spacing: .2px; margin-bottom: 10px; }
.setup-title { font-size: 28px; line-height: 1.3; font-weight: 700; letter-spacing: -.6px; }
.setup-desc { margin-top: 12px; font-size: 15px; line-height: 1.55; color: #aeaeb2; }
.field { display: block; margin-top: 26px; }
.field-label { display: block; font-size: 13px; color: #8e8e93; margin: 0 0 8px 4px; }
.field-label small { font-size: 12px; color: #636366; }
.field-input {
  width: 100%; height: 50px; padding: 0 16px;
  border: 0; outline: 0; border-radius: 13px;
  background: #1c1c1e; color: #fff; font-size: 17px;
}
.field-input:focus { box-shadow: 0 0 0 1.5px #3a3a3c inset; }
.field-input::placeholder { color: #5a5a5e; }
.field-at { display: flex; align-items: center; background: #1c1c1e; border-radius: 13px; padding-left: 16px; }
.field-at > span { color: #8e8e93; font-size: 17px; }
.field-at .field-input { padding-left: 3px; background: transparent; }
.setup-preview { min-height: 20px; margin: 9px 4px 0; font-size: 13px; color: #8e8e93; }
.setup-preview b { color: #fff; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 2px 0; }
.chip { padding: 6px 11px; border-radius: 99px; background: #1c1c1e; color: #d1d1d6; font-size: 13px; }
.chip.on { background: #fff; color: #000; }
.setup-btn {
  display: block; width: 100%; height: 52px; margin-top: 32px;
  border-radius: 14px; background: #fff; color: #000;
  font-size: 17px; font-weight: 600; text-align: center;
  transition: opacity .2s, transform .1s;
}
.setup-btn:active { transform: scale(.98); }
.setup-btn:disabled { opacity: .3; cursor: default; }
.setup-note { margin-top: 16px; font-size: 12px; line-height: 1.6; color: #636366; text-align: center; }

#screen.booting .lock { animation: boot 1.1s ease both; }
@keyframes boot { 0% { opacity: 0; filter: brightness(.2); } 100% { opacity: 1; filter: none; } }

/* ───────── 잠금화면 ───────── */
.lock {
  z-index: 50; color: #fff; overflow: hidden; touch-action: none; cursor: grab;
  background-image: var(--wall-lock), var(--wall-fallback);
  background-size: cover; background-position: center;
  transition: opacity .4s ease, transform .4s ease;
}
.lock.unlocking { opacity: 0; transform: scale(1.06); pointer-events: none; }
.lock-face { position: absolute; inset: 0; transition: transform .4s cubic-bezier(.3, .8, .3, 1), opacity .35s; }
.lock-dim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,0) 38%, rgba(0,0,0,0) 60%, rgba(0,0,0,.3)); }
.lock-head { position: absolute; left: 0; right: 0; top: calc(var(--safe-top) + 58px); text-align: center; }
.lock-pad { display: flex; justify-content: center; margin-bottom: 14px; opacity: .95; }
.lock-date { font-size: 21px; font-weight: 600; letter-spacing: -.2px; opacity: .92; }
.lock-time {
  margin-top: 0; font-size: min(104px, 26.5cqw); line-height: 1.02; font-weight: 700; letter-spacing: -1px;
  font-family: "SF Pro Rounded", ui-rounded, -apple-system, system-ui, sans-serif;
  font-variant-numeric: tabular-nums; opacity: .95;
}
.lock-notifs { position: absolute; left: 10px; right: 10px; bottom: calc(150px + var(--safe-bottom)); }
.notif {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: 22px;
  background: rgba(245, 245, 247, .62); color: #000;
  -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  animation: notifIn .6s .35s cubic-bezier(.2, .9, .3, 1.1) both;
}
@keyframes notifIn { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.n-icon { flex: none; width: 38px; height: 38px; border-radius: 9px; overflow: hidden; }
.n-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.n-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 15px; }
.n-top b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.n-time { font-size: 13px; color: rgba(60, 60, 67, .6); flex: none; }
.n-body { font-size: 15px; line-height: 1.3; }
.lock-actions { position: absolute; left: 46px; right: 46px; bottom: calc(44px + var(--safe-bottom)); display: flex; justify-content: space-between; }
.lock-btn {
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(30, 30, 35, .35);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  transition: background .2s, color .2s, transform .15s;
}
.lock-btn:active { transform: scale(1.12); }
.lock-btn.on { background: #fff; color: #000; }
.lock-btn.pulse { animation: pulse .35s; }
@keyframes pulse { 50% { transform: scale(1.15); } }
.lock-hint {
  position: absolute; left: 0; right: 0; bottom: calc(24px + var(--safe-bottom));
  text-align: center; font-size: 13px; font-weight: 500; opacity: .7;
  animation: hint 2.4s ease-in-out infinite;
}
@keyframes hint { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-4px); opacity: .85; } }

/* ───────── 홈화면 ───────── */
.home {
  z-index: 1; color: #fff;
  --icon: 15.6cqw;
  background-image: var(--wall-home), var(--wall-lock), var(--wall-fallback);
  background-size: cover; background-position: center;
  transition: transform .4s cubic-bezier(.3, .8, .3, 1), filter .4s;
}
.home.behind { transform: scale(.92); filter: brightness(.7); }
.home.wake { animation: wake .5s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes wake { from { transform: scale(1.12); opacity: .4; } to { transform: none; opacity: 1; } }

.home-grid {
  position: absolute; top: calc(var(--sb-h) + var(--safe-top) + 10px); left: 6.6cqw; right: 6.6cqw;
  display: grid; grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: calc(var(--icon) + 22px); row-gap: 3.2cqw;
}
.app-icon { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.icon-wrap { position: relative; }
.icon {
  display: block; width: var(--icon); height: var(--icon);
  border-radius: 23%; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
  transition: filter .15s, transform .15s;
}
.icon svg, .icon img { width: 100%; height: 100%; object-fit: cover; }
.app-icon:active .icon, .widget-cell:active .widget { filter: brightness(.75); }
.label { font-size: 12px; font-weight: 500; letter-spacing: -.1px; white-space: nowrap; text-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.badge {
  position: absolute; top: -5px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 11px; background: #FF3B30; color: #fff;
  font-size: 13px; font-weight: 500; display: grid; place-items: center;
}

.widget-cell { grid-column: span 2; grid-row: span 2; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.widget {
  flex: 1; width: calc(100% - 5cqw);
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  transition: filter .15s;
}
.dday {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 15px 16px 14px; background: #fff; color: #1c1c1e; text-align: left;
  background-size: cover; background-position: center;
}
.dday.has-img { color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.dday-title { font-size: 14px; font-weight: 600; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dday-bottom { display: flex; flex-direction: column; gap: 3px; }
.dday-num { font-size: 36px; font-weight: 700; letter-spacing: -1.2px; line-height: 1; }
.dday-num small { font-size: 20px; font-weight: 600; margin-left: 1px; letter-spacing: 0; }
.dday-date { font-size: 11.5px; color: #8e8e93; font-weight: 500; }
.dday.has-img .dday-date { color: rgba(255, 255, 255, .85); }

.home-search {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--icon) + 30px + 14px + 14px + var(--safe-bottom));
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 99px;
  font-size: 13px; font-weight: 600;
  background: rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.home-search svg { width: 11px; height: 11px; }
.dock {
  position: absolute; left: 3cqw; right: 3cqw; bottom: calc(12px + var(--safe-bottom));
  height: calc(var(--icon) + 30px); padding: 0 3.6cqw;
  border-radius: 9cqw;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: center; justify-items: center;
  background: rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
}

/* ── 암호 입력 ── */
.lock-pass {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  padding-top: calc(var(--safe-top) + 15cqh);
  background: rgba(10, 12, 16, .38);
  -webkit-backdrop-filter: blur(28px) saturate(1.3); backdrop-filter: blur(28px) saturate(1.3);
  opacity: 0; pointer-events: none; transition: opacity .35s;
}
.lock-pass.on { opacity: 1; pointer-events: auto; cursor: default; }
.pass-title { font-size: 20px; font-weight: 500; letter-spacing: -.2px; }
.pass-dots { display: flex; gap: 24px; margin-top: 20px; }
.pass-dots .dot { width: 13px; height: 13px; border-radius: 50%; border: 1.4px solid #fff; transition: background .1s; }
.pass-dots .dot.on { background: #fff; }
.pass-dots.shake { animation: shake .45s; }
@keyframes shake { 0%,100% { transform: none; } 15% { transform: translateX(-16px); } 35% { transform: translateX(13px); } 55% { transform: translateX(-9px); } 75% { transform: translateX(5px); } }
.pass-hint { min-height: 18px; margin-top: 12px; font-size: 13px; opacity: .8; }
.keypad {
  --k: min(78px, 20cqw);
  display: grid; grid-template-columns: repeat(3, var(--k)); gap: 3.8cqw 7cqw;
  margin-top: 5cqh;
}
.key {
  width: var(--k); height: var(--k); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .16); color: #fff;
  transition: background .25s;
}
.key.press { background: rgba(255, 255, 255, .55); transition: none; }
.key b { font-size: 36px; font-weight: 400; line-height: 1; }
.key small { font-size: 10px; font-weight: 600; letter-spacing: 2.5px; margin-top: 2px; padding-left: 2.5px; }
.key.zero { grid-column: 2; }
.pass-bottom {
  position: absolute; left: 0; right: 0; bottom: calc(44px + var(--safe-bottom));
  display: flex; justify-content: space-between; padding: 0 calc(50% - 1.5 * min(78px, 20cqw) - 7cqw + 12px);
}
.pass-text { font-size: 17px; color: #fff; padding: 6px 4px; }

/* ── 둘러보는 도중 내려오는 알림 배너 ── */
.banner {
  position: absolute; left: 8px; right: 8px; top: calc(var(--safe-top) + 8px); z-index: 96;
  display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 22px;
  background: rgba(245, 245, 247, .82); color: #000; cursor: pointer;
  -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
  transform: translateY(-140%); transition: transform .45s cubic-bezier(.2, .9, .3, 1.1);
  touch-action: none;
}
.banner.in { transform: none; }
/* PC 폰 프레임에서는 다이내믹 아일랜드 아래로 */
@media (min-width: 521px) { .banner { top: 54px; } }

/* ── 걸려오는 전화 ── */
.call-ov {
  position: absolute; inset: 0; z-index: 89; color: #fff;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--sb-h) + var(--safe-top) + 40px) 0 calc(60px + var(--safe-bottom));
  background: linear-gradient(180deg, #3a3f4a 0%, #23262d 55%, #121418 100%);
  opacity: 0; transform: scale(1.04); transition: opacity .3s ease, transform .3s ease;
}
.call-ov.in { opacity: 1; transform: none; }
.call-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ic-name { font-size: 34px; font-weight: 400; letter-spacing: -.5px; }
.ic-sub { font-size: 17px; color: rgba(255,255,255,.65); font-variant-numeric: tabular-nums; }
.call-ov.ringing .call-head { animation: ringPulse 1.6s ease-in-out infinite; }
@keyframes ringPulse { 50% { opacity: .75; } }
.call-captions { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 10px; padding: 0 28px; }
.call-captions p { max-width: 100%; padding: 10px 16px; border-radius: 16px; background: rgba(255,255,255,.12); font-size: 18px; line-height: 1.35; text-align: center; animation: capIn .35s ease both; }
.call-captions p:not(:last-child) { opacity: .5; font-size: 15px; }
@keyframes capIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.call-grid { display: none; grid-template-columns: repeat(3, 1fr); gap: 22px 26px; margin-bottom: 40px; }
.call-grid span { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.call-grid i { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); font-style: normal; }
.call-grid i b { font-size: 12px; letter-spacing: 2px; font-weight: 400; }
.call-grid small { font-size: 13px; }
.call-ring-btns { display: flex; justify-content: space-between; width: 100%; padding: 0 52px; }
.call-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #fff; }
.call-btn > svg { box-sizing: content-box; padding: 19px; border-radius: 50%; }
.call-btn.decline > svg, .call-btn.end > svg { background: #FF3B30; }
.call-btn.accept > svg { background: #34C759; }
.call-btn small { font-size: 14px; }
.call-btn.end { display: none; }
.call-ov.talking .call-ring-btns { display: none; }
.call-ov.talking .call-grid { display: grid; }
.call-ov.talking .call-btn.end { display: flex; }
.call-ov.talking .call-captions { flex: 0 0 auto; min-height: 150px; margin: 20px 0; }
.call-ov.talking .call-head { margin-bottom: auto; }
