/* Interactive demos, modelled on Find My + 1.5.0 (People and Wi-Fi tabs).
   Colours mirror Colors.swift; the app uses the iOS system font. */

/* ---------- iPhone ---------- */
.iphone {
  --frame: 12px;
  position: relative; width: 340px; max-width: calc(100vw - 56px); aspect-ratio: 340 / 720;
  padding: var(--frame); border-radius: 60px;
  background: linear-gradient(145deg, #5b5d63 0%, #2b2c30 18%, #1a1b1e 50%, #2e2f33 82%, #6a6c72 100%);
  box-shadow:
    inset 0 0 0 1.5px rgba(255,255,255,.18),
    inset 0 0 0 4px #0b0b0c,
    0 50px 90px -30px rgba(0, 0, 0, .7),
    0 18px 36px -18px rgba(0, 0, 0, .5);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; color-scheme: dark; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.iphone .btn-side { position: absolute; width: 4px; border-radius: 2px; background: linear-gradient(90deg, #45464b, #1c1d20); }
.iphone .btn-side.action { left: -3px; top: 15%; height: 4.5%; }
.iphone .btn-side.vol-up { left: -3px; top: 23%; height: 8%; }
.iphone .btn-side.vol-down { left: -3px; top: 33%; height: 8%; }
.iphone .btn-side.power { right: -3px; top: 27%; height: 13%; background: linear-gradient(270deg, #45464b, #1c1d20); }

.iscreen {
  position: absolute; inset: var(--frame); border-radius: 48px; overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  background: #0E0F11; color: #fff; isolation: isolate;
}
.island { position: absolute; z-index: 30; top: 11px; left: 50%; transform: translateX(-50%); width: 34%; height: 32px; border-radius: 20px; background: #000; pointer-events: none; }
.sb {
  position: absolute; z-index: 25; top: 0; left: 0; right: 0; height: 54px; display: flex; align-items: center; justify-content: space-between;
  padding: 4px 28px 0 40px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; pointer-events: none; color: #fff;
}
.sb .right { display: flex; gap: 6px; align-items: center; }
.sb svg { display: block; fill: currentColor; }
.home-ind { position: absolute; z-index: 45; bottom: 7px; left: 50%; transform: translateX(-50%); width: 36%; height: 5px; border-radius: 3px; background: #fff; opacity: .85; pointer-events: none; }

.app { position: absolute; inset: 0; display: flex; flex-direction: column; padding-top: 54px; background: #0E0F11; color: #fff; }
.app.out { opacity: 0; transition: opacity .25s; }
.app.in { animation: appFade .3s ease; }
@keyframes appFade { from { opacity: 0; } }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.scroll::-webkit-scrollbar { display: none; }
.tap { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tap:focus-visible { outline: 2px solid #29E0A9; outline-offset: 2px; border-radius: 10px; }
.teal { color: #29E0A9; }

/* gradient button (scanButton) */
.gbtn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 10px;
  background: linear-gradient(90deg, #22E0AA, #00D3C6); color: #0E0F11; font-weight: 700; font-size: 16px; transition: transform .12s, opacity .2s;
}
.gbtn:active { transform: scale(.97); }
.gbtn:disabled { opacity: .55; cursor: default; transform: none; }
.gbtn svg { width: 18px; height: 18px; }

/* ---------- Liquid Glass tab bar (GlassTabBar) ---------- */
.tabbar {
  position: absolute; z-index: 20; left: 12px; right: 12px; bottom: 26px; height: 46px; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 3px; border-radius: 26px; background: rgba(30, 32, 35, .78); border: 1px solid rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 0; border-radius: 22px; color: #D9D9DE; font-size: 9.5px; font-weight: 600; border: 1px solid transparent; }
.tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.tabbar button svg { width: 18px; height: 18px; flex: none; }
.tabbar button[aria-current="page"] { color: #29E0A9; background: rgba(41, 224, 169, .13); border-color: rgba(41, 224, 169, .28); }

/* ---------- Wi-Fi ---------- */
.wnav { flex: none; height: 44px; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.whead { text-align: center; padding: 50px 22px 18px; }
.orb { position: relative; width: 92px; height: 92px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; color: #0E0F11; background: linear-gradient(180deg, #00CFC3, #29E0A9); }
.orb svg { width: 46px; height: 46px; position: relative; z-index: 1; }
.orb i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #29E0A9; opacity: 0; }
.orb.pulse i { animation: wave 1.8s ease-out infinite; }
.orb.pulse i:nth-child(2) { animation-delay: .6s; }
.orb.pulse i:nth-child(3) { animation-delay: 1.2s; }
@keyframes wave { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(2.1); opacity: 0; } }
.whead h4 { margin: 46px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.whead p { margin: 9px 0 0; font-size: 13px; font-weight: 500; line-height: 1.35; color: #7C7C8A; }
.wlist { display: grid; gap: 8px; padding: 0 14px 158px; }
.cell { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; background: #16181A; border: 1px solid #202224; text-align: start; width: 100%; animation: cellIn .35s ease both; }
.cell .ic { width: 38px; height: 38px; flex: none; border-radius: 50%; background: #2A2D31; display: grid; place-items: center; color: #fff; }
.cell .ic svg { width: 19px; height: 19px; }
.cell .tx { min-width: 0; flex: 1; }
.cell b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell small { display: block; font-size: 11.5px; font-weight: 500; line-height: 1.3; color: #29E0A9; margin-top: 2px; }
.cell small.warn { color: #FF872B; }
@keyframes cellIn { from { opacity: 0; transform: translateY(8px); } }
.wfoot { position: absolute; z-index: 15; left: 0; right: 0; bottom: 84px; padding: 12px 14px 0; background: linear-gradient(to bottom, rgba(14,15,17,0), #0E0F11 30%); }
.wfoot::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 84px; background: #0E0F11; }

/* ---------- People ---------- */
.map { position: absolute; inset: 0; overflow: hidden; background: #2E3249; }
.map-inner { position: absolute; left: 0; top: 0; width: 900px; height: 1100px; transition: transform 1.1s cubic-bezier(.45,.05,.25,1); will-change: transform; }
.map-inner > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pin { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 3px; transition: opacity .4s; }
.pin .av { width: 40px; height: 40px; font-size: 16px; background: #0E0F11; }
.pin .lbl { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: rgba(14,15,17,.85); }
.map-inner.focus .pin:not(.hl) { opacity: 0; }
.pin.hl .av { box-shadow: 0 0 0 4px rgba(41,224,169,.3); animation: pinPop .5s ease; }
@keyframes pinPop { 50% { transform: scale(1.15); } }
.me { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #1AA8F9; border: 3px solid #fff; box-shadow: 0 0 0 12px rgba(26,168,249,.18); }
.locbtn { position: absolute; z-index: 5; top: 66px; right: 12px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #1AA8F9; background: rgba(28,30,40,.82); border: 1px solid rgba(255,255,255,.1); }
.locbtn svg { width: 20px; height: 20px; }

.av { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; border: 2px solid #29E0A9; color: #29E0A9; font-weight: 700; font-size: 18px; background: rgba(14,15,17,.35); position: relative; }
.psheet {
  position: absolute; z-index: 10; left: 8px; right: 8px; bottom: 82px; padding: 8px 18px 16px; border-radius: 28px;
  background: rgba(34, 54, 54, .76); border: 1px solid rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 -6px 30px rgba(0,0,0,.25);
}
.grab { width: 32px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.3); margin: 0 auto 10px; }
.phead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.phead h4 { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: -.01em; }
.gearbtn { width: 32px; height: 32px; display: grid; place-items: center; color: #29E0A9; }
.gearbtn svg { width: 24px; height: 24px; }
.prow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 0; text-align: start; }
.prow + .prow .tx { border-top: 0; }
.prow .tx { flex: 1; min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 9px; margin-bottom: -9px; }
.prow b { font-size: 16px; font-weight: 700; }
.prow small { font-size: 13px; color: #A3A8B0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .chev { width: 9px; height: 9px; flex: none; border-right: 2px solid #A3A8B0; border-top: 2px solid #A3A8B0; transform: rotate(45deg); margin-inline-end: 4px; }
.pill-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 22px; font-weight: 700; font-size: 16px; transition: transform .12s, opacity .2s; }
.pill-btn:active { transform: scale(.97); }
.pill-btn svg { width: 18px; height: 18px; flex: none; }
.pill-btn.solid { background: #29E0A9; color: #0E0F11; }
.pill-btn.grey { background: rgba(255,255,255,.12); color: #fff; }
.pill-btn:disabled { opacity: .7; cursor: default; }
.invite { width: 100%; margin-top: 16px; }

.dtop { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; color: #29E0A9; font-size: 16px; font-weight: 600; }
.backlink svg { width: 18px; height: 18px; }
.morebtn { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #29E0A9; color: #29E0A9; display: grid; place-items: center; }
.morebtn svg { width: 16px; height: 16px; }
.who { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.who .av { width: 52px; height: 52px; font-size: 21px; }
.who .av .edit { position: absolute; right: -4px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; background: #0E0F11; border: 1.5px solid #29E0A9; display: grid; place-items: center; }
.who .av .edit svg { width: 10px; height: 10px; }
.who b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.who small { display: block; font-size: 13px; color: #A3A8B0; margin-top: 2px; }
.who small.live { color: #29E0A9; }
.acts2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acts2 .wide { grid-column: 1 / -1; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ring-wave svg { animation: bell .5s ease-in-out infinite alternate; transform-origin: 50% 10%; }
@keyframes bell { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.share-card { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,.07); }
.share-card .loc { width: 26px; height: 26px; flex: none; border-radius: 50%; background: #29E0A9; color: #0E0F11; display: grid; place-items: center; }
.share-card .loc svg { width: 14px; height: 14px; }
.share-card .tx { flex: 1; min-width: 0; }
.share-card b { display: block; font-size: 14px; font-weight: 700; }
.share-card small { display: block; font-size: 11px; line-height: 1.3; color: #A3A8B0; margin-top: 2px; }
.switch { position: relative; width: 46px; height: 28px; flex: none; border-radius: 14px; background: rgba(120,120,128,.36); transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25); transition: transform .2s; }
.switch[aria-checked="true"] { background: #29E0A9; }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.fade-in { animation: fadeIn .25s ease; }

/* invite sheet (InviteCardView) */
.bsheet { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; animation: fadeIn .2s ease; }
.bsheet .card { width: 100%; background: #16181A; border-radius: 28px 28px 0 0; padding: 8px 16px 30px; animation: slideUp .3s cubic-bezier(.2,.9,.3,1); }
.bsheet h5 { margin: 6px 0 2px; font-size: 20px; font-weight: 800; }
.bsheet p { margin: 0 0 14px; font-size: 13px; color: #A3A8B0; line-height: 1.35; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: grid; justify-items: start; gap: 3px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.07); text-align: start; }
.tile.wide { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; justify-items: start; column-gap: 10px; background: #29E0A9; color: #0E0F11; }
.tile svg { width: 20px; height: 20px; color: #29E0A9; }
.tile.wide svg { color: #0E0F11; }
.tile b { font-size: 14px; font-weight: 700; }
.tile small { font-size: 11.5px; color: #A3A8B0; }
.points { margin: 12px 0 0; text-align: center; font-size: 11.5px; color: #7C7C8A; }
.bsheet .cancel { display: block; width: 100%; margin-top: 10px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.08); font-weight: 600; font-size: 15px; }

/* iOS action sheet (dark) */
.asheet { position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,.4); display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 0 8px 30px; animation: fadeIn .2s ease; }
.asheet .grp { border-radius: 14px; overflow: hidden; background: rgba(44,44,46,.96); animation: slideUp .28s cubic-bezier(.2,.9,.3,1); }
.asheet button { display: block; width: 100%; height: 50px; font-size: 17px; color: #0A84FF; border-top: .5px solid rgba(84,84,88,.6); }
.asheet .grp button:first-child { border-top: 0; }
.asheet .tap:focus-visible { outline-offset: -3px; border-radius: 12px; }
.asheet button.destructive { color: #FF453A; }
.asheet button.bold { font-weight: 600; }

/* iOS alert (dark) */
.ios-dim { position: absolute; inset: 0; z-index: 50; background: rgba(0,0,0,.45); display: grid; place-items: center; animation: fadeIn .18s ease; }
.ios-alert { width: 78%; border-radius: 16px; overflow: hidden; background: rgba(44,44,46,.97); color: #fff; text-align: center; animation: pop .22s cubic-bezier(.2,.9,.3,1.2); }
.ios-alert .body { padding: 18px 16px 16px; }
.ios-alert h5 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.25; }
.ios-alert p { margin: 4px 0 0; font-size: 13px; line-height: 1.32; }
.ios-alert .btns { display: flex; border-top: .5px solid rgba(84,84,88,.6); }
.ios-alert .btns button { flex: 1; padding: 12px 6px; font-size: 16px; color: #0A84FF; font-family: inherit; background: none; border: 0; cursor: pointer; }
.ios-alert .btns button + button { border-left: .5px solid rgba(84,84,88,.6); }
.ios-alert .btns .bold { font-weight: 600; }
.ios-alert .btns .destructive { color: #FF453A; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { transform: scale(1.12); opacity: 0; } }
@keyframes slideUp { from { transform: translateY(100%); } }

/* toast */
.toast { position: absolute; z-index: 60; pointer-events: none; left: 50%; top: 62px; transform: translateX(-50%); width: 86%; background: rgba(58,60,66,.96); color: #fff; border-radius: 16px; padding: 11px 14px; font-size: 12.5px; line-height: 1.35; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: toastIn .3s ease; }
.maps ~ .toast { top: 134px; }
.locbtn { transition: opacity .2s; }
.iscreen.toasting .locbtn { opacity: 0; }
.toast b { display: block; font-size: 14px; margin-bottom: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -10px); } }

/* ---------- Demo switch (above the phone) ---------- */
.demo-seg {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; width: 340px; max-width: calc(100vw - 56px);
  padding: 3px; border-radius: 14px; background: color-mix(in srgb, var(--text) 8%, transparent);
}
.demo-seg button {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: 0;
  padding: 8px 6px; border-radius: 11px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s, box-shadow .2s;
}
.demo-seg button svg { width: 16px; height: 16px; flex: none; }
.demo-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.25), 0 0 0 .5px rgba(255,255,255,.06); }
.demo-seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- idle tour cursor ---------- */
.tcursor { position: absolute; z-index: 100; left: 0; top: 0; width: 22px; height: 26px; margin: -2px 0 0 -3px; pointer-events: none; opacity: 0; filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); transition-property: left, top; transition-timing-function: cubic-bezier(.45,.05,.25,1); }
.tcursor.show { opacity: 1; transition-property: left, top, opacity; }
.tcursor svg { display: block; width: 100%; height: 100%; transform-origin: 4px 3px; transition: transform .12s; }
.tcursor.press svg { animation: tPress .3s ease; }
.tcursor i { position: absolute; left: 4px; top: 3px; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 2px solid rgba(41, 224, 169, .85); opacity: 0; }
.tcursor.press i { animation: tRing .45s ease-out; }
@keyframes tPress { 50% { transform: scale(.85); } }
@keyframes tRing { 0% { opacity: 1; transform: scale(.3); } 100% { opacity: 0; transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) {
  .tcursor { display: none; }
  .orb.pulse i, .ring-wave svg, .spin { animation: none; }
  .map-inner { transition: none; }
}

/* ---------- profile photos + Directions (maps app) ---------- */
.av.photo { background-size: cover; background-position: center; color: transparent; }
.asheet .ttl { margin: 0; padding: 13px 16px; text-align: center; font-size: 13px; color: #8E8E93; }
.asheet .ttl + button { border-top: .5px solid rgba(84,84,88,.6); }
.maps { position: absolute; inset: 0; z-index: 20; overflow: hidden; background: #2E3249; animation: appIn .35s cubic-bezier(.2,.9,.3,1); }
@keyframes appIn { from { transform: scale(.94); opacity: 0; } }
.maps .map-inner { transition: transform .8s cubic-bezier(.45,.05,.25,1); }
.maps .route { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.maps .pin.dst .av { width: 38px; height: 38px; border-color: #FF453A; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.maps .pin.dst.hl .av { box-shadow: 0 0 0 5px rgba(255,69,58,.3); }
.sb.crumbed > span:first-child { visibility: hidden; }
.crumb { position: absolute; z-index: 31; top: 18px; left: 22px; font-size: 12px; font-weight: 600; color: #fff; }
.mtop { position: absolute; z-index: 2; top: 56px; left: 10px; right: 10px; display: grid; gap: 7px; padding: 11px 14px; border-radius: 16px; background: rgba(28,30,36,.94); box-shadow: 0 6px 20px rgba(0,0,0,.35); font-size: 13px; font-weight: 600; }
.mtop div { display: flex; align-items: center; gap: 9px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtop .dot { box-sizing: border-box; width: 12px; height: 12px; flex: none; border-radius: 50%; }
.mtop .dot.from { background: #1AA8F9; border: 2px solid #fff; }
.mtop .dot.to { background: #FF453A; }
.mbot { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 16px 18px 30px; border-radius: 22px 22px 0 0; background: #1C1E24; box-shadow: 0 -6px 24px rgba(0,0,0,.35); }
.mbot .eta { display: flex; align-items: baseline; gap: 6px; }
.mbot .eta b { font-size: 22px; font-weight: 800; color: #29E0A9; }
.mbot .eta span { font-size: 14px; color: #A3A8B0; }
.mbot .mode { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 12.5px; color: #A3A8B0; }
.mbot .mode svg { width: 14px; height: 14px; }
.mnote { margin: 8px 0 12px; font-size: 11px; line-height: 1.35; color: #7C7C8A; }
.mstart { display: block; width: 100%; height: 44px; border-radius: 22px; background: #1AA8F9; color: #fff; font-weight: 700; font-size: 16px; }
.mstart.end { background: #FF453A; }
.mstart:disabled { opacity: .55; cursor: default; }
/* right-to-left (Arabic): chevrons and back arrows point the other way, as on iOS */
html[dir="rtl"] .prow .chev { transform: rotate(-135deg); }
html[dir="rtl"] .backlink svg { transform: scaleX(-1); }
