:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Arabic", "IBM Plex Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Arabic", "IBM Plex Sans Arabic", "Segoe UI", sans-serif;

  /* iOS dark mode semantic colors */
  --bg: #000;
  --bg-grouped: #000;
  --cell: #1c1c1e;
  --cell-2: #2c2c2e;
  --fill: rgba(118, 118, 128, .24);
  --sep: rgba(84, 84, 88, .6);
  --label: #fff;
  --label-2: rgba(235, 235, 245, .6);
  --label-3: rgba(235, 235, 245, .3);
  --blue: #0a84ff;
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --yellow: #ffd60a;
  --purple: #8950d7;
  --purple-2: #672abb;
  --glass: rgba(40, 40, 46, .55);
  --glass-strong: rgba(30, 30, 34, .78);
  --bubble-in: #26262a;
  --bubble-out: #1f6f4a;

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-icon: 22.5%;
  --r-phone: 55px;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;

  --t-caption: 12px;
  --t-footnote: 13px;
  --t-sub: 15px;
  --t-body: 17px;
  --t-title3: 20px;
  --t-title2: 22px;
  --t-title1: 28px;
  --t-large: 34px;

  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.36, .64, 1);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; color: var(--label); font-family: var(--font); }
body { overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
img { display: block; }

#stage { position: fixed; inset: 0; display: grid; place-items: center; }

#phone {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #0b0816;
  isolation: isolate;
  touch-action: manipulation;
}

/* Desktop: show the phone centered in a frame */
@media (min-width: 700px) {
  #stage { background: radial-gradient(1200px 700px at 50% 40%, #241a3a 0%, #0b0a12 55%, #000 100%); }
  #phone {
    width: 390px;
    height: 844px;
    border-radius: var(--r-phone);
    box-shadow: 0 0 0 11px #111, 0 0 0 13px #3a3a3c, 0 40px 120px rgba(0, 0, 0, .7);
    transform: scale(var(--fit, 1));
  }
  .island { display: block !important; }
}

/* ---------- Wallpaper ---------- */
.wallpaper {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(1.2px 1.2px at 12% 14%, #fff 98%, transparent),
    radial-gradient(1px 1px at 28% 32%, #fff 98%, transparent),
    radial-gradient(1.4px 1.4px at 46% 9%, #fff 98%, transparent),
    radial-gradient(1px 1px at 63% 24%, #fff 98%, transparent),
    radial-gradient(1.2px 1.2px at 82% 12%, #fff 98%, transparent),
    radial-gradient(1px 1px at 90% 38%, #fff 98%, transparent),
    radial-gradient(1px 1px at 8% 48%, #fff 98%, transparent),
    radial-gradient(1.3px 1.3px at 36% 52%, #fff 98%, transparent),
    radial-gradient(1px 1px at 72% 46%, #fff 98%, transparent),
    radial-gradient(1px 1px at 55% 62%, #fff 98%, transparent),
    radial-gradient(1px 1px at 20% 66%, #fff 98%, transparent),
    radial-gradient(160% 70% at 50% 100%, #7a3b52 0%, #3b1f4f 30%, #16112e 62%, #070612 100%);
  opacity: 1;
}
.dunes { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Status bar ---------- */
.statusbar {
  position: absolute; top: 0; inset-inline: 0; z-index: 60;
  height: 54px; padding: 12px 30px 0;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: var(--t-body); letter-spacing: -.2px;
  pointer-events: none; transition: color .3s var(--ease);
}
.statusbar.dark-text { color: var(--label); }
.sb-time { min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; direction: ltr; }
.island { display: none; position: absolute; top: 11px; left: 50%; width: 124px; height: 36px; margin-left: -62px; border-radius: 20px; background: #000; }
.sb-icons { display: flex; align-items: center; gap: 6px; direction: ltr; }
.sb-icons svg { fill: currentColor; }
.sb-signal { width: 18px; height: 12px; }
.sb-wifi { width: 16px; height: 12px; }
.sb-battery { display: flex; align-items: center; gap: 3px; }
.sb-battery svg { width: 27px; height: 13px; }
.sb-batt-num { font-size: 11px; font-weight: 700; color: var(--red); }
.statusbar.locked .sb-time { visibility: hidden; }

/* ---------- Lock screen ---------- */
.lock {
  position: absolute; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  padding: 54px 0 0;
  transition: transform .55s var(--ease), opacity .4s var(--ease);
}
.lock.unlocked { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.lock-top { text-align: center; padding: var(--s-2) var(--s-5) 0; transition: opacity .3s var(--ease), filter .3s var(--ease); }
.lock-glyph { width: 22px; height: 22px; margin: 0 auto var(--s-1); opacity: .9; }
.lock-glyph svg { width: 100%; height: 100%; fill: currentColor; }
.lock-glyph.shake { animation: shake .5s var(--ease); }
.lock-date { font-size: var(--t-title3); font-weight: 600; opacity: .92; }
.lock-clock {
  font-family: var(--font-display);
  font-size: 96px; line-height: 1; font-weight: 700; letter-spacing: -2px;
  direction: ltr; margin-top: 2px;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, .82) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lost-msg { margin-top: var(--s-3); display: grid; gap: 2px; }
.lost-msg strong { font-size: var(--t-body); font-weight: 700; }
.lost-msg span { font-size: var(--t-sub); color: rgba(255, 255, 255, .78); }

.notifs {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s-5) var(--s-3) var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px, #000 calc(100% - 22px), transparent 100%);
  scrollbar-width: none;
}
.notifs::-webkit-scrollbar { display: none; }
.notif {
  display: flex; gap: var(--s-3); align-items: flex-start; text-align: start;
  padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--glass); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  animation: rise .5s var(--ease-out) both;
  width: 100%;
}
.notif .ic { width: 38px; height: 38px; flex: none; border-radius: 9px; overflow: hidden; }
.notif .body { flex: 1; min-width: 0; }
.notif .row { display: flex; justify-content: space-between; gap: var(--s-2); }
.notif .ttl { font-weight: 600; font-size: var(--t-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif .when { font-size: var(--t-footnote); color: rgba(255, 255, 255, .55); flex: none; }
.notif .txt { font-size: var(--t-sub); line-height: 1.35; color: rgba(255, 255, 255, .92); }
.notif .more { font-size: var(--t-footnote); color: rgba(255, 255, 255, .55); margin-top: 2px; }

.lock-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-2) 46px 46px;
}
.round-btn {
  width: 50px; height: 50px; border-radius: 50%;
  background: rgba(30, 30, 34, .5); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  display: grid; place-items: center; transition: transform .35s var(--spring), background .2s;
}
.round-btn:active { transform: scale(1.12); background: rgba(255, 255, 255, .3); }
.round-btn svg { width: 22px; height: 22px; fill: #fff; }
.swipe-hint { font-size: var(--t-sub); color: rgba(255, 255, 255, .7); animation: breathe 2.6s ease-in-out infinite; padding: var(--s-2); }

.lock.code .lock-top, .lock.code .notifs, .lock.code .lock-bottom { opacity: 0; pointer-events: none; }
.lock.code::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px);
  animation: fade .3s var(--ease) both;
}

/* ---------- Passcode ---------- */
.passcode {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  padding: 92px var(--s-6) 40px;
  animation: fade .3s var(--ease) both;
}
.pc-head { display: flex; flex-direction: column; align-items: center; min-height: 170px; }
.faceid { width: 56px; height: 56px; color: #fff; margin-bottom: var(--s-3); transition: opacity .25s var(--ease), color .25s; }
.faceid svg { width: 100%; height: 100%; }
.faceid.scan .fi-eyes, .faceid.scan .fi-nose, .faceid.scan .fi-mouth { animation: scan 1s ease-in-out infinite; }
.faceid.fail { color: var(--red); animation: shake .5s var(--ease); }
.faceid.fail .fi-mouth { d: path("M23 47c3-3 6-4 9-4s6 1 9 4"); }
.faceid.gone { opacity: 0; height: 0; margin: 0; }
.pc-title { font-size: var(--t-title3); font-weight: 500; margin-bottom: var(--s-5); }
.pc-dots { display: flex; gap: 22px; direction: ltr; }
.pc-dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #fff; transition: background .12s; }
.pc-dots i.on { background: #fff; }
.pc-dots.shake { animation: shake .45s var(--ease); }
.pc-hint { min-height: 44px; margin-top: var(--s-4); font-size: var(--t-sub); text-align: center; color: rgba(255, 255, 255, .85); max-width: 290px; line-height: 1.4; }
.pc-hint b { color: var(--yellow); font-weight: 600; }
.pc-pad {
  display: grid; grid-template-columns: repeat(3, 78px); gap: 16px 26px;
  direction: ltr; margin-top: auto;
}
.pc-key {
  width: 78px; height: 78px; border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: background .25s ease-out;
}
.pc-key:active, .pc-key.press { background: rgba(255, 255, 255, .45); transition: none; }
.pc-key b { font-size: 34px; font-weight: 400; line-height: 1; font-family: var(--font-display); }
.pc-key small { font-size: 10px; letter-spacing: 2px; font-weight: 600; margin-top: 1px; opacity: .9; }
.pc-key.zero { grid-column: 2; }
.pc-foot { width: 100%; display: flex; justify-content: space-between; padding: var(--s-5) 22px 0; }
.pc-link { font-size: var(--t-body); padding: var(--s-2); }

/* ---------- Home ---------- */
.home {
  position: absolute; inset: 0; z-index: 10;
  padding: 64px 22px 0;
  display: flex; flex-direction: column;
  transition: transform .45s var(--ease), filter .45s var(--ease), opacity .45s var(--ease);
}
.home.pre { opacity: 0; visibility: hidden; }
.home.enter { animation: homeIn .6s var(--ease-out) both; }
.home.behind { transform: scale(.92); filter: blur(6px) brightness(.6); }
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 18px; }
.widget {
  aspect-ratio: 1; border-radius: var(--r-lg); padding: 14px;
  display: flex; flex-direction: column; text-align: start; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.w-weather { background: linear-gradient(180deg, #1b2a52 0%, #2c3d72 100%); }
.w-weather .city { font-weight: 600; font-size: var(--t-sub); }
.w-weather .temp { font-size: 44px; font-weight: 300; line-height: 1.05; font-family: var(--font-display); direction: ltr; text-align: end; }
.w-weather .cond { margin-top: auto; font-size: var(--t-footnote); line-height: 1.3; }
.w-weather .cond span { opacity: .75; display: block; }
.w-cal { background: #1c1c1e; }
.w-cal .day { color: var(--red); font-size: var(--t-footnote); font-weight: 700; }
.w-cal .num { font-size: 30px; font-weight: 400; line-height: 1.1; font-family: var(--font-display); }
.w-cal .ev { margin-top: auto; border-inline-start: 3px solid var(--purple); padding-inline-start: 7px; font-size: var(--t-footnote); line-height: 1.3; }
.w-cal .ev + .ev { margin-top: 6px; border-color: var(--orange); }
.w-cal .ev span { display: block; color: var(--label-2); }
.widget-label { font-size: 11px; text-align: center; margin-top: 6px; opacity: .9; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); row-gap: 22px; }
.app-icon { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
.app-icon .ico {
  width: 62px; height: 62px; border-radius: var(--r-icon); overflow: hidden; position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .25);
  transition: transform .35s var(--spring), filter .2s;
}
.app-icon:active .ico { transform: scale(.88); filter: brightness(.75); transition-duration: .1s; }
.app-icon .lbl { font-size: 12px; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); white-space: nowrap; }
.badge {
  position: absolute; top: -6px; inset-inline-end: 0;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--red); color: #fff; font-size: 13px; font-weight: 600;
  display: grid; place-items: center; direction: ltr; z-index: 1;
}
.app-icon.pulse .ico { animation: nudge 2.4s var(--ease) 1.5s 2; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: auto; margin-bottom: 14px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.dots i.on { background: #fff; }
.dock {
  display: grid; grid-template-columns: repeat(4, 1fr);
  margin: 0 -10px 22px; padding: 16px 10px; border-radius: 32px;
  background: rgba(60, 60, 70, .38); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%);
}
.dock .lbl { display: none; }

/* Icon artwork */
.ico svg { width: 100%; height: 100%; display: block; }
.ico-chat { background: linear-gradient(180deg, #5df27a 0%, #10b832 100%); }
.ico-phone { background: linear-gradient(180deg, #5df27a 0%, #10b832 100%); }
.ico-safari { background: linear-gradient(180deg, #fff 0%, #e6e6ea 100%); }
.ico-music { background: linear-gradient(180deg, #ff6b7d 0%, #fb2c4d 100%); }
.ico-photos { background: #fff; }
.ico-camera { background: linear-gradient(180deg, #d9d9de 0%, #9b9ba3 100%); }
.ico-clock { background: #000; }
.ico-notes { background: linear-gradient(180deg, #ffd84d 0 24%, #fffef8 24% 100%); }
.ico-maps { background: #e9efe2; }
.ico-settings { background: linear-gradient(180deg, #9a9aa2 0%, #6b6b73 100%); }
.ico-cal { background: #fff; color: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ico-cal .d { color: #ff3b30; font-size: 10px; font-weight: 600; margin-top: -2px; }
.ico-cal .n { font-size: 30px; line-height: 1; font-weight: 300; font-family: var(--font-display); }
.ico-gryb img { width: 100%; height: 100%; }
.notif .ic .ico, .bar-row .ic .ico { display: block; width: 100%; height: 100%; }
.notif .ico-cal .n { font-size: 17px; }
.notif .ico-cal .d { font-size: 7px; margin: 0; }

/* ---------- App window ---------- */
.appwin {
  position: absolute; inset: 0; z-index: 30; background: var(--bg);
  overflow: hidden;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  animation: appOpen .5s var(--ease-out) both;
}
.appwin.closing { animation: appClose .38s var(--ease) both; }
.page {
  position: absolute; inset: 0; background: var(--bg);
  display: flex; flex-direction: column;
  transition: transform .45s var(--ease), filter .45s var(--ease);
}
.page.push-in { animation: pushIn .45s var(--ease) both; }
.page.under { transform: translateX(30%); filter: brightness(.7); }
.page.pop-out { animation: popOut .38s var(--ease) both; }
.nav {
  flex: none; padding: 54px var(--s-2) 0; min-height: 98px;
  background: rgba(18, 18, 20, .82); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: .5px solid var(--sep);
  position: relative; z-index: 2;
}
.nav.plain { background: var(--bg); border-bottom-color: transparent; }
.nav-row { display: flex; align-items: center; min-height: 44px; gap: var(--s-2); }
.nav-back { display: flex; align-items: center; gap: 2px; color: var(--blue); font-size: var(--t-body); padding: var(--s-2) var(--s-1); flex: none; }
.nav-back svg { width: 12px; height: 20px; }
.nav-title { font-weight: 600; font-size: var(--t-body); flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-spacer { width: 60px; flex: none; }
.large-title { font-size: var(--t-large); font-weight: 700; padding: 0 var(--s-2) var(--s-2); letter-spacing: -.3px; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 40px; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }

/* Lists */
.list { margin: 0 var(--s-4); border-radius: var(--r-sm); background: var(--cell); overflow: hidden; }
.list.flush { margin: 0; border-radius: 0; background: transparent; }
.section-h { font-size: var(--t-footnote); color: var(--label-2); padding: 22px 32px 7px; }
.cell {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: start;
  padding: 11px var(--s-4); min-height: 44px; position: relative;
}
.cell + .cell::before { content: ""; position: absolute; top: 0; inset-inline-start: var(--indent, 16px); inset-inline-end: 0; border-top: .5px solid var(--sep); }
button.cell:active { background: var(--cell-2); }
.cell .main { flex: 1; min-width: 0; }
.cell .main > .t, .cell .main > .s { display: block; }
.cell .t { font-size: var(--t-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .s { font-size: var(--t-sub); color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.cell .v { color: var(--label-2); font-size: var(--t-body); flex: none; }
.chev { width: 8px; height: 14px; flex: none; color: var(--label-3); }
.sq { width: 29px; height: 29px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.sq svg { width: 18px; height: 18px; fill: #fff; }

/* Chats */
.chat-cell { --indent: 82px; padding-block: 9px; }
.avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 600; font-size: 20px; color: #fff;
}
.avatar.sm { width: 36px; height: 36px; font-size: 15px; }
.chat-cell .top { display: flex; justify-content: space-between; gap: var(--s-2); align-items: baseline; }
.chat-cell .t { font-weight: 600; }
.chat-cell .time { font-size: var(--t-sub); color: var(--label-2); flex: none; }
.chat-cell .time.unread { color: var(--green); }
.chat-cell .bottom { display: flex; justify-content: space-between; gap: var(--s-2); align-items: center; }
.chat-cell .s { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.ubadge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--green); color: #000; font-size: 13px; font-weight: 600; display: grid; place-items: center; padding: 0 6px; direction: ltr; flex: none; }
.search { margin: 0 var(--s-4) var(--s-2); height: 36px; border-radius: var(--r-sm); background: var(--fill); display: flex; align-items: center; gap: 6px; padding: 0 var(--s-2); color: var(--label-2); font-size: var(--t-body); }
.search svg { width: 16px; height: 16px; fill: currentColor; }

.chat-head { display: flex; align-items: center; gap: var(--s-2); flex: 1; min-width: 0; }
.chat-head .who { min-width: 0; }
.chat-head .n { font-weight: 600; font-size: var(--t-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .seen { font-size: var(--t-caption); color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-bg {
  background-color: #0b0b0d;
  background-image: radial-gradient(rgba(255, 255, 255, .035) 1px, transparent 1.2px);
  background-size: 18px 18px;
}
.thread { display: flex; flex-direction: column; gap: 3px; padding: var(--s-3) var(--s-3) var(--s-4); }
.day-sep { align-self: center; margin: var(--s-3) 0 var(--s-2); font-size: var(--t-caption); padding: 4px 10px; border-radius: 8px; background: rgba(40, 40, 44, .9); color: var(--label-2); }
.sys { align-self: center; margin: var(--s-2) 0; font-size: var(--t-caption); padding: 4px 10px; border-radius: 8px; background: rgba(40, 40, 44, .9); color: var(--label-2); text-align: center; }
.msg { max-width: 78%; padding: 6px 10px 5px; border-radius: 16px; font-size: var(--t-body); line-height: 1.32; position: relative; word-wrap: break-word; }
.msg.in { align-self: flex-start; background: var(--bubble-in); border-start-start-radius: 6px; }
.msg.out { align-self: flex-end; background: var(--bubble-out); border-start-end-radius: 6px; }
.msg.cont { border-radius: 16px; }
.msg + .msg.newgroup { margin-top: 6px; }
.msg .from { font-size: var(--t-footnote); font-weight: 600; display: block; margin-bottom: 1px; }
.msg .meta { float: left; font-size: 11px; color: rgba(255, 255, 255, .55); margin: 8px 8px -2px 0; direction: ltr; }
.msg.photo { padding: 4px; }
.msg.photo .ph { width: 220px; height: 150px; border-radius: 12px; display: grid; place-items: center; font-size: 54px; }
.msg.photo .cap { padding: 4px 6px 0; }
.composer {
  flex: none; display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3) 34px; background: rgba(18, 18, 20, .92); border-top: .5px solid var(--sep);
}
.composer .field { flex: 1; height: 36px; border-radius: 18px; background: var(--cell); border: .5px solid var(--sep); color: var(--label-3); padding: 0 var(--s-3); display: flex; align-items: center; font-size: var(--t-sub); }
.composer svg { width: 26px; height: 26px; fill: var(--blue); flex: none; }

/* Photos */
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ptile { aspect-ratio: 1; display: grid; place-items: center; font-size: 40px; position: relative; }
.ptile:active { filter: brightness(.8); }
.ptile .vid { position: absolute; bottom: 4px; inset-inline-start: 6px; font-size: 11px; font-weight: 600; }
.pview { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.pview .big { aspect-ratio: 4/5; display: grid; place-items: center; font-size: 120px; }
.pview .desc { padding: var(--s-4) var(--s-5); font-size: var(--t-sub); line-height: 1.5; color: var(--label-2); }
.pview .desc b { color: var(--label); display: block; font-size: var(--t-body); margin-bottom: 2px; }

/* Notes */
.note-body { padding: 0 var(--s-5) var(--s-6); font-size: var(--t-body); line-height: 1.6; white-space: pre-line; }
.note-body h2 { font-size: var(--t-title2); margin: 0 0 var(--s-2); }
.note-date { text-align: center; color: var(--label-2); font-size: var(--t-footnote); padding: var(--s-2) 0 var(--s-4); }
.check { display: flex; gap: var(--s-2); align-items: flex-start; }
.check i { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--label-3); flex: none; margin-top: 4px; display: grid; place-items: center; }
.check.done i { background: var(--yellow); border-color: var(--yellow); }
.check.done i::after { content: ""; width: 9px; height: 5px; border: 2px solid #000; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check.done span { color: var(--label-2); text-decoration: line-through; }
.notes-tint .nav-back { color: var(--yellow); }

/* Phone recents */
.missed .t { color: var(--red); }
.call-ic { width: 16px; height: 16px; fill: var(--label-3); flex: none; }

/* Calendar */
.cal-day { padding: 0 var(--s-4); }
.cal-ev { display: flex; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: .5px solid var(--sep); }
.cal-ev .tm { width: 64px; color: var(--label-2); font-size: var(--t-sub); flex: none; }
.cal-ev .bar { width: 4px; border-radius: 2px; flex: none; }
.cal-ev .t { font-weight: 600; }
.cal-ev .s { color: var(--label-2); font-size: var(--t-sub); }

/* Maps */
.map { flex: 1; position: relative; background: #1d2620; overflow: hidden; }
.map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-card {
  position: absolute; inset-inline: var(--s-3); bottom: 34px; padding: var(--s-4);
  border-radius: var(--r-lg); background: var(--glass-strong); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.map-card .t { font-weight: 700; font-size: var(--t-title3); }
.map-card .s { color: var(--label-2); font-size: var(--t-sub); margin-top: 2px; }

/* Camera */
.cam { flex: 1; display: flex; flex-direction: column; background: #000; }
.cam .vf {
  flex: 1; margin-top: 98px;
  background:
    linear-gradient(90deg, transparent calc(33.3% - .5px), rgba(255, 255, 255, .18) 33.3%, transparent calc(33.3% + .5px), transparent calc(66.6% - .5px), rgba(255, 255, 255, .18) 66.6%, transparent calc(66.6% + .5px)),
    linear-gradient(180deg, transparent calc(33.3% - .5px), rgba(255, 255, 255, .18) 33.3%, transparent calc(33.3% + .5px), transparent calc(66.6% - .5px), rgba(255, 255, 255, .18) 66.6%, transparent calc(66.6% + .5px)),
    radial-gradient(120% 80% at 50% 70%, #3a2a24 0%, #120c0c 70%);
}
.cam .ctl { height: 170px; display: flex; align-items: center; justify-content: center; }
.cam .shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; padding: 4px; }
.cam .shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; }

/* Clock */
.alarm { display: flex; align-items: center; padding: var(--s-3) var(--s-4); border-bottom: .5px solid var(--sep); }
.alarm .main { flex: 1; }
.alarm .tm { font-size: 50px; font-weight: 300; font-family: var(--font-display); line-height: 1.05; }
.alarm .tm small { font-size: 26px; }
.alarm.off .tm, .alarm.off .s { color: var(--label-2); }
.toggle { display: inline-block; width: 51px; height: 31px; border-radius: 16px; background: var(--fill); position: relative; flex: none; }
.toggle::after { content: ""; position: absolute; top: 2px; right: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .3s var(--spring); }
.toggle.on { background: var(--green); }
.toggle.on::after { transform: translateX(-20px); }

/* Music */
.np { margin: var(--s-4); padding: var(--s-4); border-radius: var(--r-lg); background: linear-gradient(160deg, #4a2a1a, #1a1010); display: flex; gap: var(--s-4); align-items: center; }
.np .art { width: 96px; height: 96px; border-radius: var(--r-sm); display: grid; place-items: center; font-size: 46px; background: linear-gradient(135deg, #ff9a3c, #b2361a); flex: none; }
.np .t { font-weight: 700; font-size: var(--t-title3); }
.np .s { color: var(--label-2); font-size: var(--t-sub); margin-top: 4px; }

/* Safari */
.safari-bar { flex: none; padding: var(--s-2) var(--s-4) 34px; background: rgba(18, 18, 20, .92); border-top: .5px solid var(--sep); }
.safari-bar .addr { height: 44px; border-radius: var(--r-md); background: var(--cell-2); display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--label-2); font-size: var(--t-body); }
.safari-bar svg { width: 16px; height: 16px; fill: currentColor; }
.fav-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); padding: 0 var(--s-4); }
.fav { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: var(--t-caption); color: var(--label-2); }
.fav .b { width: 60px; height: 60px; border-radius: var(--r-md); background: var(--cell); display: grid; place-items: center; font-size: 26px; overflow: hidden; }
.fav .b img { width: 100%; height: 100%; }

/* Settings */
.profile { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.profile .avatar { width: 60px; height: 60px; font-size: 24px; }
.bars { padding: var(--s-4); }
.bar-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; }
.bar-row .ic { width: 29px; height: 29px; border-radius: 7px; overflow: hidden; flex: none; }
.bar-row .main { flex: 1; }
.bar-row .track { height: 6px; border-radius: 3px; background: var(--fill); margin-top: 5px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.bar-row .pct { color: var(--label-2); font-size: var(--t-sub); direction: ltr; }
.batt-hero { display: flex; align-items: center; justify-content: space-between; padding: var(--s-4); }
.batt-hero .big { font-size: 44px; font-weight: 700; color: var(--red); direction: ltr; font-family: var(--font-display); }

/* ---------- Gryb explainer ---------- */
.gryb { background: #000; }
.gryb-splash { position: absolute; inset: 0; z-index: 5; background: #000; display: grid; place-items: center; animation: fade .35s var(--ease) .75s reverse both; pointer-events: none; }
.gryb-splash img { width: 120px; height: 120px; border-radius: var(--r-icon); }
.gx-close {
  position: absolute; top: 56px; inset-inline-start: var(--s-4); z-index: 3;
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .12);
  display: grid; place-items: center;
}
.gx-close svg { width: 12px; height: 12px; stroke: #fff; stroke-width: 2.4; }
.gryb::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 54px; z-index: 2; background: linear-gradient(#000 40%, transparent); pointer-events: none; }
.gx { padding: 92px 0 48px; text-align: center; }
.gx-hero { padding: 0 var(--s-6); position: relative; }
.gx-hero::before {
  content: ""; position: absolute; left: 50%; top: -60px; width: 420px; height: 320px; margin-left: -210px; z-index: -1;
  background: radial-gradient(closest-side, rgba(137, 80, 215, .45), transparent);
}
.gx-icon { width: 104px; height: 104px; border-radius: var(--r-icon); margin: 0 auto var(--s-4); box-shadow: 0 12px 40px rgba(137, 80, 215, .45); }
.gx h1 { margin: 0; font-size: var(--t-large); font-weight: 800; letter-spacing: -.3px; }
.gx .lead { margin: var(--s-2) auto 0; font-size: var(--t-title3); line-height: 1.4; color: rgba(255, 255, 255, .88); max-width: 300px; }
.gx .story { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--s-4); padding: 6px 12px; border-radius: 99px; background: rgba(137, 80, 215, .18); color: #c9a8ff; font-size: var(--t-footnote); font-weight: 600; }
.cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: var(--s-5) var(--s-5) 0; height: 56px; border-radius: 16px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-2) 100%);
  color: #fff; text-decoration: none; font-size: 18px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(137, 80, 215, .45);
  transition: transform .3s var(--spring), filter .2s;
}
.cta:active { transform: scale(.97); filter: brightness(.9); }
.cta svg { width: 22px; height: 22px; fill: #fff; }
.cta-note { margin-top: var(--s-2); font-size: var(--t-footnote); color: var(--label-2); }
.gx-h2 { font-size: var(--t-title2); font-weight: 700; margin: 40px var(--s-5) var(--s-4); text-align: start; }
.steps {
  display: flex; gap: var(--s-3); overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--s-5) var(--s-2);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.steps::-webkit-scrollbar { display: none; }
.step { flex: 0 0 72%; scroll-snap-align: center; text-align: start; }
.step .shot { border-radius: var(--r-xl); overflow: hidden; background: #000; border: .5px solid rgba(255, 255, 255, .14); aspect-ratio: 540 / 830; }
.step .shot img { width: 100%; height: 100%; object-fit: cover; }
.step .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--purple); font-size: var(--t-footnote); font-weight: 700; margin: var(--s-3) 0 var(--s-1); }
.step h3 { margin: 0; font-size: var(--t-body); font-weight: 700; }
.step p { margin: 2px 0 0; font-size: var(--t-sub); color: var(--label-2); line-height: 1.4; }
.feats { margin: 36px var(--s-5) 0; display: grid; gap: var(--s-2); text-align: start; }
.feat { display: flex; gap: var(--s-3); align-items: flex-start; padding: 14px; border-radius: var(--r-md); background: var(--cell); }
.feat .fi { width: 36px; height: 36px; border-radius: 10px; background: rgba(137, 80, 215, .2); display: grid; place-items: center; flex: none; }
.feat .fi svg { width: 20px; height: 20px; fill: #b78cff; }
.feat b { display: block; font-size: var(--t-body); }
.feat span { font-size: var(--t-sub); color: var(--label-2); line-height: 1.4; }
.gx-foot { margin-top: 28px; color: var(--label-3); font-size: var(--t-footnote); }

/* ---------- Banner + alert ---------- */
.banner {
  position: absolute; top: 52px; inset-inline: 8px; z-index: 70;
  display: flex; gap: var(--s-3); align-items: center; text-align: start;
  padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--glass-strong); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  animation: bannerIn .55s var(--spring) both;
}
.banner.out { animation: bannerOut .35s var(--ease) both; }
.banner img { width: 38px; height: 38px; border-radius: 9px; flex: none; }
.banner .body { flex: 1; min-width: 0; }
.banner .row { display: flex; justify-content: space-between; }
.banner .ttl { font-weight: 600; font-size: var(--t-sub); }
.banner .when { font-size: var(--t-footnote); color: var(--label-2); }
.banner .txt { font-size: var(--t-sub); }

.alert-scrim { position: absolute; inset: 0; z-index: 80; background: rgba(0, 0, 0, .35); display: grid; place-items: center; animation: fade .2s ease-out both; }
.alert-box {
  width: 270px; border-radius: var(--r-md); overflow: hidden; text-align: center;
  background: rgba(37, 37, 41, .92); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  animation: alertIn .3s var(--spring) both;
}
.alert-box .c { padding: 19px 16px 15px; }
.alert-box h4 { margin: 0 0 2px; font-size: var(--t-body); font-weight: 600; }
.alert-box p { margin: 0; font-size: var(--t-footnote); line-height: 1.35; }
.alert-box .btns { display: grid; border-top: .5px solid var(--sep); }
.alert-box .btns button { height: 44px; color: var(--blue); font-size: var(--t-body); }
.alert-box .btns button + button { border-top: .5px solid var(--sep); }

/* ---------- Home indicator ---------- */
.homebar { position: absolute; bottom: 0; left: 50%; z-index: 90; width: 180px; height: 26px; margin-left: -90px; display: grid; place-items: center; }
.homebar i { width: 134px; height: 5px; border-radius: 3px; background: #fff; opacity: .9; }

/* ---------- Motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }
@keyframes breathe { 50% { opacity: .35; } }
@keyframes shake { 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes scan { 50% { opacity: .25; } }
@keyframes homeIn { from { transform: scale(1.12); opacity: 0; } }
@keyframes appOpen { from { transform: scale(.12); opacity: 0; border-radius: 40px; } }
@keyframes appClose { to { transform: scale(.12); opacity: 0; border-radius: 40px; } }
@keyframes pushIn { from { transform: translateX(-100%); } }
@keyframes popOut { to { transform: translateX(-100%); } }
@keyframes bannerIn { from { transform: translateY(-140%); } }
@keyframes bannerOut { to { transform: translateY(-140%); opacity: 0; } }
@keyframes alertIn { from { transform: scale(1.15); opacity: 0; } }
@keyframes nudge { 0%, 100% { transform: none; } 8% { transform: rotate(-8deg) scale(1.06); } 16% { transform: rotate(7deg) scale(1.06); } 24% { transform: rotate(-4deg); } 32% { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
