[data-install-app][hidden],
.install-dialog[hidden] {
  display: none !important;
}

body.install-dialog-open {
  overflow: hidden;
}

.install-app-button {
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.install-app-button:not([hidden]) {
  display: inline-flex;
}

.install-app-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.install-dialog {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 18px max(14px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  background: rgba(24, 25, 31, .58);
  backdrop-filter: blur(8px);
  overscroll-behavior: contain;
}

.install-dialog-panel {
  position: relative;
  width: min(100%, 440px);
  padding: 25px 23px 22px;
  border: 1px solid #d8cbb3;
  border-radius: 16px;
  color: #4c4655;
  background: #fffaf0;
  box-shadow: 0 24px 60px rgba(45, 42, 67, .28);
}

.install-dialog-close {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #4c4655;
  background: transparent;
  cursor: pointer;
  font-size: 23px;
}

.install-dialog-close:hover {
  background: #eee3cf;
}

.install-dialog-kicker {
  margin: 0 48px 7px 0;
  color: #8b6334;
  font-size: 12px;
  font-weight: 700;
}

.install-dialog-title {
  margin: 0 48px 12px 0;
  color: #2d2a43;
  font-family: Georgia, "Songti SC", serif;
  font-size: 23px;
  line-height: 1.35;
}

.install-dialog-copy {
  margin: 0;
  color: #655e63;
  font-size: 14px;
  line-height: 1.75;
}

.install-dialog-steps {
  display: grid;
  gap: 9px;
  margin: 17px 0 0;
  padding: 0;
  list-style: none;
}

.install-dialog-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.6;
}

.install-dialog-steps span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 50%;
  color: #fffaf0;
  background: #4b6f9d;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.install-dialog-note {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #b98b4b;
  color: #6b625e;
  background: #f4eddf;
  font-size: 12px;
  line-height: 1.65;
}

.install-dialog-action {
  width: 100%;
  min-height: 46px;
  margin-top: 18px;
  border: 1px solid #4b6f9d;
  border-radius: 8px;
  color: #fffaf0;
  background: #4b6f9d;
  cursor: pointer;
  font-weight: 700;
}

:root[data-theme="dark"] .install-dialog-panel,
html.dark .install-dialog-panel {
  border-color: #625846;
  color: #e3dacc;
  background: #2b2a27;
}

:root[data-theme="dark"] .install-dialog-title,
:root[data-theme="dark"] .install-dialog-close,
html.dark .install-dialog-title,
html.dark .install-dialog-close {
  color: #f5eee2;
}

:root[data-theme="dark"] .install-dialog-copy,
:root[data-theme="dark"] .install-dialog-note,
html.dark .install-dialog-copy,
html.dark .install-dialog-note {
  color: #b9ad9d;
}

:root[data-theme="dark"] .install-dialog-note,
html.dark .install-dialog-note {
  background: #36342f;
}

:root[data-theme="dark"] .install-dialog-close:hover,
html.dark .install-dialog-close:hover {
  background: #36342f;
}

@media (max-width: 640px) {
  .install-app-label {
    display: none;
  }

  .install-dialog {
    padding-top: max(18px, env(safe-area-inset-top, 0px));
  }

  .install-dialog-panel {
    padding-right: 20px;
    padding-left: 20px;
    border-radius: 14px;
  }
}

@media (min-width: 641px) {
  .install-dialog {
    place-items: center;
  }
}
