/* iPhone recreation of DMP TapConnect (dark, iOS 26 glass). Designed at 390 x 844 pt, scaled as a whole. */
.phone-wrap {
  position: relative;
  height: calc(var(--stage-h) - 8px);
  aspect-ratio: 414 / 868;
  flex: 0 0 auto;
}
.phone {
  position: absolute;
  left: 0;
  top: 0;
  width: 414px;
  height: 868px;
  transform-origin: 0 0;
  transform: scale(var(--phone-scale, 0.75));
  border-radius: 68px;
  padding: 12px;
  background: linear-gradient(145deg, #3a3a3e, #121214 40%, #2a2a2d);
  box-shadow: 0 0 0 1.5px #5a5a60, 0 30px 60px -20px rgba(0, 0, 0, 0.45), 0 12px 24px -12px rgba(0, 0, 0, 0.35);
}
.screen {
  position: relative;
  width: 390px;
  height: 844px;
  border-radius: 56px;
  overflow: hidden;
  background: #000;
  color: #fff;
  font: 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -0.01em;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}
.island {
  position: absolute;
  top: 11px;
  left: 50%;
  width: 124px;
  height: 36px;
  margin-left: -62px;
  border-radius: 20px;
  background: #000;
  z-index: 60;
}
.status {
  position: absolute;
  inset: 0 0 auto 0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 30px 0 46px;
  font-weight: 600;
  font-size: 17px;
  z-index: 55;
  pointer-events: none;
}
.status .icons { display: flex; gap: 6px; align-items: center; }
.status svg { display: block; fill: currentColor; }
.home-ind {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 140px;
  height: 5px;
  margin-left: -70px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
  z-index: 55;
}

/* Screens ---------------------------------------------------------------- */
.scr {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transition: opacity 350ms var(--ease-out), transform 480ms var(--ease-drawer), visibility 0s linear 480ms;
}
.scr[data-on] { opacity: 1; visibility: visible; transition: opacity 350ms var(--ease-out), transform 480ms var(--ease-drawer), visibility 0s; }
.scr[data-from="right"] { transform: translateX(100%); opacity: 1; visibility: visible; transition: none; }
.scr[data-to="left"] { transform: translateX(-28%); opacity: 0.4; }
.app-bg {
  background: linear-gradient(135deg, #000 2%, #0a6dff 50%, #000 98%);
}
.app-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(14, 16, 24, 0.58);
  z-index: 0;
}
.app-bg > * { position: relative; z-index: 1; }
.sys-bg { background: #000; }

.glass {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0.75px 0 rgba(255, 255, 255, 0.32), inset 0 0 0 0.75px rgba(255, 255, 255, 0.12), 0 10px 26px -10px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
}
.secondary { color: rgba(235, 235, 245, 0.6); }
.caption { font-size: 12px; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; fill: currentColor; }

/* Press + touch feedback */
.pressable { transition: transform 140ms var(--ease-out); }
.pressable[data-pressed] { transform: scale(0.97); }
.touch {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  z-index: 70;
  transition: opacity 260ms ease, transform 160ms var(--ease-out);
}
.touch[data-on] { opacity: 1; transform: scale(1); transition: opacity 120ms ease, transform 160ms var(--ease-out); }

/* Text fields with typing caret */
.field { display: block; padding: 16px; min-height: 54px; white-space: nowrap; overflow: hidden; }
.field .v:empty::before { content: attr(data-ph); color: rgba(235, 235, 245, 0.32); }
.field[data-typing] .v::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 1px;
  vertical-align: -0.18em;
  background: #fff;
  animation: caret 1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* Login ------------------------------------------------------------------- */
.login { display: flex; flex-direction: column; align-items: center; padding: 120px 16px 0; }
.login .logo { width: 195px; }
.login .tc { font-size: 30px; font-weight: 600; margin: 2px 0 50px; color: rgba(235, 235, 245, 0.6); }
.login .box { width: 100%; border-radius: 20px; }
.login .box .field + .field { border-top: 0.5px solid rgba(255, 255, 255, 0.12); }
.login .remember { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0; color: rgba(235, 235, 245, 0.6); }
.switch { width: 63px; height: 28px; border-radius: 14px; background: #34c759; position: relative; }
.switch::after { content: ""; position: absolute; right: 2px; top: 2px; width: 37px; height: 24px; border-radius: 12px; background: #fff; }
.pill { display: inline-flex; gap: 8px; align-items: center; padding: 16px 20px; border-radius: 999px; margin-top: 30px; }
.pill.tint { background: rgba(0, 127, 200, 0.55); }
/* Mirrors LogInView: .offset(y: -200) + .easeInOut(duration: 0.9) in the real app (deliberately faithful). */
.login-in { transform: translateY(-200px); opacity: 0; transition: transform 900ms cubic-bezier(0.42, 0, 0.58, 1), opacity 900ms cubic-bezier(0.42, 0, 0.58, 1); }
.login-in[data-shown] { transform: none; opacity: 1; }

/* Navigation chrome --------------------------------------------------------- */
.nav-bar { position: absolute; top: 54px; left: 0; right: 0; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; z-index: 5; }
.circle-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; }
.large-title { font-size: 34px; font-weight: 700; letter-spacing: 0.01em; padding: 104px 16px 6px; }
.bottom-bar { position: absolute; left: 0; right: 0; bottom: 30px; display: flex; justify-content: space-between; padding: 0 22px; z-index: 5; }
.bottom-bar .circle-btn { width: 50px; height: 50px; font-size: 21px; }
.bottom-bar .search { height: 50px; border-radius: 25px; padding: 0 18px; display: flex; align-items: center; gap: 8px; color: rgba(235, 235, 245, 0.6); }

/* List */
.list-body { padding: 18px 16px; }
.scanning { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: rgba(235, 235, 245, 0.6); transition: opacity 250ms ease; }
.spinner { width: 22px; height: 22px; animation: spin 1s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.devices { opacity: 0; transition: opacity 250ms ease; }
.empty-hint { display: none; min-height: 260px; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: rgba(235, 235, 245, 0.6); text-align: center; }
.empty-hint[data-on] { display: flex; animation: pane-in 250ms var(--ease-out); }
.empty-hint .ic { width: 26px; height: 26px; }
.devices[data-on] { opacity: 1; }
.devices .caption { margin: 0 2px 12px; }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px 14px 14px;
  border-radius: 14px;
  opacity: 0;
  translate: 0 10px;
  transition: opacity 300ms var(--ease-out), translate 300ms var(--ease-out), transform 140ms var(--ease-out);
}
.devices[data-on] .row { opacity: 1; translate: none; transition: opacity 300ms var(--ease-out) 80ms, translate 300ms var(--ease-out) 80ms, transform 140ms var(--ease-out); }
.row .prod-tile { flex: none; width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0.75px 0 rgba(255, 255, 255, 0.25), inset 0 0 0 0.75px rgba(255, 255, 255, 0.1); }
.row .prod-ic { width: 44px; height: 32px; transform: scaleX(-1); }
.row .prod-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row .name { font-weight: 700; font-size: 17px; }
.row .chev { margin-left: auto; color: rgba(235, 235, 245, 0.6); }

/* System alert (Bluetooth, "settato") */
.alert-scrim { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.32); z-index: 50; opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s linear 200ms; }
.alert-scrim[data-on] { opacity: 1; visibility: visible; transition: opacity 200ms ease, visibility 0s; }
.alert {
  width: 300px;
  border-radius: 34px;
  padding: 22px 18px 16px;
  text-align: center;
  background: rgba(44, 44, 48, 0.86);
  transform: scale(1.08);
  opacity: 0;
  transition: opacity 150ms ease, transform 0s linear 200ms;
}
.alert-scrim[data-on] .alert { transform: none; opacity: 1; transition: transform 220ms var(--ease-out), opacity 180ms ease; }
.alert h4 { margin: 0 0 6px; font-size: 17px; font-weight: 600; line-height: 1.25; }
.alert p { margin: 0 0 18px; font-size: 14px; color: rgba(235, 235, 245, 0.8); }
.alert .btns { display: flex; gap: 10px; }
.alert .btns span { flex: 1; padding: 13px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-weight: 600; }
.alert .btns span.main { background: #0a84ff; }

/* Detail -------------------------------------------------------------------- */
.seg { position: absolute; top: 106px; left: 16px; right: 16px; height: 50px; border-radius: 25px; display: flex; padding: 4px; z-index: 4; }
.seg span { flex: 1; display: grid; place-items: center; font-weight: 700; font-size: 16px; opacity: 0.5; position: relative; z-index: 1; transition: opacity 250ms ease; }
.seg span[data-on] { opacity: 1; }
.seg .sel { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 21px; background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0.75px 0 rgba(255, 255, 255, 0.3); transition: transform 350ms var(--ease-drawer); }
.detail-scroll { position: absolute; top: 160px; left: 0; right: 0; bottom: 0; overflow: hidden; }
.detail-inner { transition: none; }
.hero { height: 200px; display: grid; place-items: center; }
.hero img { height: 188px; width: auto; filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.45)); }
.hero img[data-in] { animation: bounce-in 700ms var(--ease-out) 200ms both; }
@keyframes bounce-in { from { transform: scale(0.92); opacity: 0; } }
.info { margin: 10px 16px 24px; border-radius: 10px; padding: 4px 0; }
.info .cell { display: flex; justify-content: space-between; gap: 12px; padding: 15px 16px; font-size: 16px; position: relative; }
.info .cell + .cell::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: 0.5px; background: rgba(255, 255, 255, 0.14); }
.info .info-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 16px 6px; margin-top: 6px; border-top: 0.5px solid rgba(255, 255, 255, 0.22); font-size: 16px; }
.info .info-head .ic { color: #0a84ff; }
.info .cell b { font-weight: 600; }
.info .cell span { color: rgba(235, 235, 245, 0.6); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles { display: grid; gap: 10px; padding: 16px; }
.tile { border-radius: 10px; padding: 16px; height: 112px; display: flex; flex-direction: column; justify-content: space-between; }
.tile .t-ic { width: 30px; height: 30px; color: rgba(235, 235, 245, 0.6); }
.tile .t-name { font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile[data-focus] { box-shadow: inset 0 0.75px 0 rgba(255, 255, 255, 0.32), 0 0 0 2px rgba(10, 132, 255, 0.9), 0 10px 26px -10px rgba(0, 0, 0, 0.55); }
.pane { display: none; }
.pane[data-on] { display: block; animation: pane-in 200ms var(--ease-out); }
@keyframes pane-in { from { opacity: 0; } }

/* Sheet (ControlView, medium detent) ---------------------------------------- */
.sheet-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); opacity: 0; visibility: hidden; z-index: 30; transition: opacity 500ms var(--ease-drawer), visibility 0s linear 500ms; }
.sheet-scrim[data-on] { opacity: 1; visibility: visible; transition: opacity 500ms var(--ease-drawer), visibility 0s; }
.sheet {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 452px;
  border-radius: 46px;
  background: rgba(28, 28, 32, 0.9);
  -webkit-backdrop-filter: blur(30px) saturate(1.4);
  backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: inset 0 0.75px 0 rgba(255, 255, 255, 0.2), 0 -10px 40px rgba(0, 0, 0, 0.4);
  z-index: 40;
  transform: translateY(110%);
  transition: transform 500ms var(--ease-drawer);
  display: flex;
  flex-direction: column;
  padding: 18px 8px 10px;
}
.sheet[data-on] { transform: none; }
.sheet .s-ic { width: 40px; height: 40px; color: #0a84ff; margin: 16px 16px 0; }
.sheet h3 { font-size: 17px; font-weight: 600; margin: 14px 16px 4px; }
.sheet .desc { font-size: 16px; line-height: 1.32; color: rgba(235, 235, 245, 0.6); margin: 0 16px; }
.slider {
  position: relative;
  margin: 18px 16px 0;
  height: 52px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(10, 132, 255, 0.1);
}
.slider .fill {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  background: linear-gradient(90deg, rgba(10, 132, 255, 0) 0%, rgba(10, 132, 255, 0.5) 100%);
}
.slider[data-drag] .fill { background: linear-gradient(90deg, rgba(10, 132, 255, 0.2) 0%, rgba(10, 132, 255, 0.7) 100%); }
.slider .handle { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; margin-left: -1px; background: #0a84ff; }
.slider .scale { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: repeating-linear-gradient(90deg, rgba(10, 132, 255, 0.55) 0 1px, transparent 1px 8.4px); opacity: 0.8; }
.slider .lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; font-size: 15.5px; }
.slider .lbl .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slider .lbl .val { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.slider[data-drag] .lbl .n { color: #0a84ff; }
.sheet .set { margin: auto 8px 0; padding: 17px; border-radius: 999px; background: #0a84ff; text-align: center; font-weight: 700; box-shadow: inset 0 0.75px 0 rgba(255, 255, 255, 0.35); }

/* App Store / Messages / TestFlight (simplified system screens) --------------- */
.sys { padding: 64px 20px 0; }
.sys .back { color: #0a84ff; font-size: 17px; display: flex; align-items: center; gap: 4px; height: 44px; }
.store-head { display: flex; gap: 16px; align-items: center; margin-top: 14px; }
.app-ic { width: 118px; height: 118px; border-radius: 26px; overflow: hidden; flex: 0 0 auto; box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.15); }
.app-ic img, .app-ic svg { width: 100%; height: 100%; display: block; }
.store-head h2 { margin: 0; font-size: 22px; font-weight: 700; }
.store-head .dev { font-size: 15px; color: rgba(235, 235, 245, 0.6); margin: 2px 0 14px; }
.get { display: inline-grid; place-items: center; min-width: 78px; height: 30px; padding: 0 16px; border-radius: 15px; background: #0a84ff; font-size: 15px; font-weight: 700; position: relative; }
.get .ring { display: none; width: 28px; height: 28px; }
.get[data-state="loading"] { background: transparent; min-width: 30px; padding: 0; }
.get[data-state="loading"] .t { display: none; }
.get[data-state="loading"] .ring { display: block; }
.get[data-state="done"] { background: rgba(255, 255, 255, 0.14); color: #0a84ff; }
.sys .para { margin-top: 26px; padding-top: 16px; border-top: 0.5px solid rgba(255, 255, 255, 0.15); color: rgba(235, 235, 245, 0.8); font-size: 15px; }
.mail .mail-from { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.mail .mail-from .av { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(#6b6b72, #3a3a40); display: grid; place-items: center; font-weight: 700; }
.mail .mail-from span:last-child { display: flex; flex-direction: column; }
.mail .mail-from small { font-size: 13px; color: rgba(235, 235, 245, 0.6); }
.mail .mail-subj { margin: 18px 0 10px; font-size: 22px; font-weight: 700; line-height: 1.2; }
.mail .mail-body { margin: 0 0 16px; font-size: 16px; line-height: 1.4; color: rgba(235, 235, 245, 0.85); }
.msg-head { position: absolute; top: 54px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 10px; border-bottom: 0.5px solid rgba(255, 255, 255, 0.12); }
.msg-head .av { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(#6b6b72, #3a3a40); display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.msg-head .who { font-size: 12px; }
.bubbles { position: absolute; top: 170px; left: 14px; right: 60px; display: grid; gap: 8px; }
.bubble { background: #26262a; border-radius: 20px; padding: 10px 14px; font-size: 16px; }
.link-card { border-radius: 18px; overflow: hidden; background: #26262a; }
.link-card .lc-top { height: 128px; display: grid; place-items: center; background: linear-gradient(#1b2a44, #0d1626); }
.link-card .lc-top .app-ic { width: 76px; height: 76px; border-radius: 18px; }
.link-card .lc-b { padding: 10px 14px; }
.link-card .lc-b b { display: block; font-size: 15px; }
.link-card .lc-b span { font-size: 13px; color: rgba(235, 235, 245, 0.6); }
.tf-title { font-size: 34px; font-weight: 700; margin-top: 4px; }
.tf-card { margin-top: 20px; border-radius: 22px; padding: 18px; background: #1c1c1e; display: flex; gap: 14px; align-items: center; }
.tf-card .app-ic { width: 64px; height: 64px; border-radius: 15px; }
.tf-card h3 { margin: 0; font-size: 17px; }
.tf-card p { margin: 2px 0 0; font-size: 13px; color: rgba(235, 235, 245, 0.6); }
.tf-card .get { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  .scr, .scr[data-on] { transition: opacity 200ms ease, visibility 0s; transform: none !important; }
  .sheet { transition: opacity 200ms ease; transform: none; opacity: 0; }
  .sheet[data-on] { opacity: 1; }
  .alert { transform: none; }
  .hero img[data-in] { animation: none; }
  .login-in { transform: none; transition: opacity 200ms ease; }
  .seg .sel { transition: none; }
  .spinner { animation: none; }
}
