:root {
  color-scheme: dark;
  --ink: #f7f9ff;
  --muted: #9aa5ba;
  --panel: rgba(15, 20, 34, 0.84);
  --line: rgba(255, 255, 255, 0.1);
  --cyan: #10d8ff;
  --blue: #2878ff;
  --violet: #8a38ff;
  --bg: #080b14;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
.app-shell {
  width: 100%;
  min-width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: fixed;
  inset: 0;
  isolation: isolate;
}

.control-frame {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #f4f6fb;
  opacity: 0;
  transition: opacity 420ms var(--ease);
}

.control-frame.is-ready {
  opacity: 1;
}

.launch-screen,
.state-panel {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding:
    max(28px, env(safe-area-inset-top))
    max(22px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(22px, env(safe-area-inset-left));
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 20%, rgba(29, 69, 136, 0.22), transparent 38%),
    linear-gradient(155deg, #080b14 0%, #0b1020 48%, #070910 100%);
}

.launch-screen {
  transition: opacity 360ms var(--ease), visibility 360ms var(--ease);
}

.launch-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  filter: blur(22px);
  opacity: 0.18;
  pointer-events: none;
  animation: drift 8s ease-in-out infinite alternate;
}

.ambient-one {
  top: 8%;
  left: -16%;
  width: min(56vw, 360px);
  aspect-ratio: 1;
  background: var(--blue);
}

.ambient-two {
  right: -14%;
  bottom: 5%;
  width: min(50vw, 320px);
  aspect-ratio: 1;
  background: var(--violet);
  animation-delay: -3s;
}

.launch-content {
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logo-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(78vw, 310px);
  min-height: 112px;
  margin-bottom: 34px;
}

.logo-glow {
  position: absolute;
  width: 72%;
  height: 64%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  filter: blur(46px);
  opacity: 0.16;
  animation: breathe 2.8s ease-in-out infinite;
}

.launch-logo {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: transparent;
  mix-blend-mode: screen;
  filter: none;
  animation: rise 680ms var(--ease) both;
}

.loading-line {
  width: min(58vw, 210px);
  height: 3px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.loading-line span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--violet));
  box-shadow: 0 0 18px rgba(36, 173, 255, 0.65);
  animation: load 1.35s ease-in-out infinite;
}

.launch-status,
.launch-hint,
.private-label {
  margin: 0;
  color: var(--muted);
}

.launch-status {
  min-height: 24px;
  font-size: 14px;
  letter-spacing: 0.015em;
}

.launch-actions {
  width: 100%;
  display: grid;
  gap: 10px;
  margin-top: 24px;
  animation: rise 360ms var(--ease) both;
}

.launch-hint {
  max-width: 340px;
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.55;
}

.primary-action,
.secondary-action {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  padding: 0 20px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, background 160ms ease;
}

.primary-action {
  border: 0;
  color: #fff;
  font-weight: 750;
  background: linear-gradient(120deg, #087cf4, #693cf2);
  box-shadow: 0 14px 34px rgba(36, 86, 238, 0.28);
}

.secondary-action {
  border: 1px solid var(--line);
  color: #dbe3f3;
  background: rgba(255, 255, 255, 0.055);
}

.primary-action:active,
.secondary-action:active,
.install-pill:active {
  transform: scale(0.98);
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
.install-pill:focus-visible,
.sheet-backdrop:focus-visible {
  outline: 3px solid rgba(16, 216, 255, 0.65);
  outline-offset: 3px;
}

.private-label {
  position: absolute;
  z-index: 2;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.private-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #39dda0;
  box-shadow: 0 0 12px rgba(57, 221, 160, 0.7);
}

.state-panel {
  z-index: 20;
  background: rgba(7, 9, 16, 0.94);
  backdrop-filter: blur(18px);
}

.state-card {
  width: min(100%, 390px);
  padding: 32px 24px 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

.state-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 18px;
  color: #9fb5dc;
  background: rgba(255, 255, 255, 0.06);
}

.state-icon svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.state-card h1 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 24px;
}

.state-card p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.state-card .primary-action {
  width: 100%;
}

.install-pill {
  position: fixed;
  z-index: 30;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  background: rgba(11, 15, 27, 0.9);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  animation: rise 400ms var(--ease) both;
}

.install-pill svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sheet-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(8px);
}

.install-sheet {
  position: relative;
  width: min(100%, 520px);
  padding: 12px 22px max(22px, env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  color: var(--ink);
  background: #111624;
  box-shadow: 0 -28px 70px rgba(0, 0, 0, 0.45);
  animation: sheet-up 360ms var(--ease) both;
}

.sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.sheet-heading {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 15px;
  align-items: center;
}

.sheet-heading img {
  width: 62px;
  height: 62px;
  border-radius: 17px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.sheet-heading h2,
.sheet-heading p {
  margin: 0;
}

.sheet-heading h2 {
  margin-bottom: 5px;
  font-size: 20px;
}

.sheet-heading p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.install-steps {
  display: grid;
  gap: 13px;
  margin: 24px 0;
  padding-left: 24px;
  color: #d8dfed;
  font-size: 14px;
  line-height: 1.5;
}

.full-width {
  width: 100%;
}

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: max(72px, calc(env(safe-area-inset-bottom) + 60px));
  max-width: calc(100% - 36px);
  padding: 11px 16px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #eef3fc;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  background: rgba(14, 19, 31, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
  animation: toast-in 240ms var(--ease) both;
}

@keyframes load {
  0% { transform: translateX(-120%); }
  50% { transform: translateX(115%); }
  100% { transform: translateX(250%); }
}

@keyframes breathe {
  50% { opacity: 0.3; transform: scale(1.08); }
}

@keyframes drift {
  to { transform: translate3d(22px, -18px, 0) scale(1.08); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 700px) {
  .install-sheet {
    margin-bottom: 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
  }
}
