#installDialog {
  --install-paper: #fffaf6;
  --install-ink: #28261f;
  --install-muted: #62564d;
  --install-accent: #9a381d;
  --install-line: #dfc6b7;
  --install-panel: #fff1e6;
  box-sizing: border-box;
  width: min(420px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid var(--install-line);
  border-radius: 28px;
  background: var(--install-paper);
  color: var(--install-ink);
  box-shadow: 0 24px 84px #21170f55;
}

#installDialog[open] { animation: install-enter .46s cubic-bezier(.19, 1, .22, 1) both; }
#installDialog::backdrop { background: #201a16a8; backdrop-filter: blur(7px); }
#installDialog[open]::backdrop { animation: install-fade .26s ease-out both; }
#installDialog [hidden] { display: none !important; }

#installClose {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--install-line);
  border-radius: 50%;
  background: var(--install-paper);
  color: var(--install-ink);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.install-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 158px;
  overflow: hidden;
  background: radial-gradient(ellipse at 54% 40%, #ffd6b6 0%, #ffe6d6 35%, var(--install-paper) 78%);
}

.install-orbit {
  position: absolute;
  width: 208px;
  height: 73px;
  border: 1px solid #ba663c5c;
  border-radius: 50%;
  transform: rotate(-18deg);
}

.install-device {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 112px;
  border: 1px solid #e6ba9c;
  border-radius: 22px;
  background: linear-gradient(148deg, #fff, #fff4e9);
  box-shadow: 8px 15px 28px #81351635, inset 0 0 0 4px #fff8ef;
}

.install-device::before {
  content: "";
  position: absolute;
  top: 8px;
  width: 18px;
  height: 3px;
  border-radius: 8px;
  background: #dbb29a;
}

.install-device img { width: 47px; height: 47px; filter: drop-shadow(0 5px 8px #b648243d); }
.install-spark { position: absolute; width: 9px; height: 9px; border-radius: 3px; background: #b45330; transform: rotate(45deg); }
.install-spark-left { left: calc(50% - 91px); top: 51%; }
.install-spark-right { right: calc(50% - 96px); top: 29%; width: 6px; height: 6px; }
#installDialog[open] .install-device { animation: install-device-in .71s cubic-bezier(.2, .8, .24, 1) both; }
#installDialog[open] .install-orbit,
#installDialog[open] .install-spark { animation: install-fade .6s .12s ease-out both; }

.install-check {
  position: absolute;
  left: calc(50% + 20px);
  top: 92px;
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 3px solid var(--install-paper);
  border-radius: 50%;
  background: #335c46;
  color: #fff;
  font-size: 17px;
  font-weight: 800;
}

#installDialog[data-state="installed"] .install-check {
  display: grid;
  animation: install-check-in .48s cubic-bezier(.2, .85, .3, 1.25) both;
}

.install-content { padding: 0 24px 18px; text-align: center; }
#installCopy { margin-bottom: 20px; }
#installTitle { margin: 0 0 8px; font-size: clamp(1.5rem, 6vw, 1.95rem); line-height: 1.1; letter-spacing: -.035em; }
#installDescription { margin: 0; color: var(--install-muted); font-size: 1rem; line-height: 1.45; }

#installInstructions {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 13px 14px 13px 35px;
  border: 1px solid var(--install-line);
  border-radius: 17px;
  background: var(--install-panel);
  text-align: left;
  font-size: .94rem;
  line-height: 1.45;
  animation: install-enter .28s ease-out both;
}
#installInstructions li::marker { color: var(--install-accent); font-weight: 800; }

#installContinue, #installDismiss {
  width: 100%;
  min-height: 48px;
  margin: 0;
  border-radius: 15px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease;
}
#installContinue { border: 1px solid transparent; background: var(--install-accent); color: #fff; }
#installDismiss { border: 1px solid transparent; background: transparent; color: var(--install-muted); }
#installContinue:not(:disabled):active, #installDismiss:active { transform: scale(.98); }
#installContinue:disabled { opacity: .76; cursor: wait; }
#installDialog button:focus-visible { outline: 2px solid var(--install-ink); outline-offset: 3px; }

[data-theme="dark"] #installDialog {
  --install-paper: #25241f;
  --install-ink: #fff4e9;
  --install-muted: #e0cfc1;
  --install-accent: #a14429;
  --install-line: #735e4e;
  --install-panel: #352a24;
}
[data-theme="dark"] .install-art { background: radial-gradient(ellipse at 54% 40%, #6b4330, #3d2e25 57%, var(--install-paper) 79%); }
[data-theme="dark"] #installInstructions li::marker { color: #ffba99; }

@keyframes install-enter { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes install-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes install-device-in { from { opacity: 0; transform: translateY(18px) rotate(-13deg) scale(.85); } to { opacity: 1; transform: rotate(-7deg); } }
@keyframes install-check-in { from { opacity: 0; transform: scale(.35) rotate(-22deg); } to { opacity: 1; transform: none; } }

@media (max-height: 570px) {
  .install-art { height: 122px; }
  .install-check { top: 72px; }
  .install-content { padding-inline: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  #installDialog[open], #installDialog[open]::backdrop, #installDialog *,
  #installDialog[open] .install-device, #installDialog[open] .install-spark,
  #installDialog[open] .install-orbit, #installDialog[data-state="installed"] .install-check {
    animation: none;
    transition: none;
  }
}
