* { box-sizing: border-box; }

body {
  --space-top: max(12px, env(safe-area-inset-top));
  --space-bottom: max(12px, env(safe-area-inset-bottom));
  margin: 0;
  height: 100dvh;
  min-width: 0;
  padding: var(--space-top) max(12px, env(safe-area-inset-right))
    var(--space-bottom) max(12px, env(safe-area-inset-left));
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 28%, #f8f9fc 0%, #e5e8f1 73%);
  color: #24324b;
  font: 16px system-ui, sans-serif;
}

.phone {
  position: relative;
  width: min(100%, 414px, max(358px, calc((100dvh - 24px) * .478)));
  height: min(894px, calc(100dvh - var(--space-top) - var(--space-bottom)));
  min-height: 0;
  padding: 6px;
  border: 1px solid #626876;
  border-radius: 39px;
  background: linear-gradient(135deg, #484e5c, #212530 36%, #353b49);
  box-shadow: 0 22px 54px #1d273936, 0 3px 9px #1d273926;
}

.phone::before, .phone::after {
  position: absolute;
  left: 100%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #424956;
  content: "";
}

.phone::before { top: 15%; height: 64px; }
.phone::after { top: calc(15% + 85px); height: 37px; }

.phone-screen {
  height: 100%;
  display: grid;
  grid-template-rows: 29px minmax(0, 1fr) 32px;
  border-radius: 32px;
  overflow: hidden;
  background: #f7f6fb;
}

.status-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 17px;
  color: #242b37;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.front-camera {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  width: 13px;
  height: 13px;
  border: 2px solid #242730;
  border-radius: 50%;
  background: radial-gradient(circle at 44% 36%, #596789 0, #212938 27%, #111318 62%);
}

.status-icons { flex: none; }

.app-screen { position: relative; min-height: 0; min-width: 0; }
#app-host { position: absolute; inset: 0; }
#loading {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
}
#loading img { border-radius: 22px; }
#loading strong { font-size: 22px; }
#loading p { margin: 0 16px; }

.system-navigation {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  place-items: center;
  background: #262a33;
  color: #d8dbe4;
}
.system-navigation svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 470px), (max-height: 660px) {
  body {
    --space-top: max(5px, env(safe-area-inset-top));
    --space-bottom: max(5px, env(safe-area-inset-bottom));
    padding: var(--space-top) max(6px, env(safe-area-inset-right))
      var(--space-bottom) max(6px, env(safe-area-inset-left));
  }
  .phone { padding: 4px; border-radius: 29px; }
  .phone-screen { border-radius: 24px; grid-template-rows: 25px minmax(0, 1fr) 27px; }
  .front-camera { top: 5px; width: 12px; height: 12px; }
}
