.pwa-install-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border: 0;
  border-radius: 8px;
  max-height: min(720px, calc(100dvh - 32px));
  overflow: auto;
  color: #172334;
  background: #fff;
  box-shadow: 0 22px 60px rgba(11, 30, 50, 0.24);
}

.pwa-install-dialog::backdrop {
  background: rgba(9, 25, 42, 0.56);
}

.pwa-install-dialog h2 {
  margin: 18px 0 8px;
  font-size: 22px;
  letter-spacing: 0;
}

.pwa-install-intro {
  margin: 0 0 18px;
  color: #516071;
  font-size: 15px;
  line-height: 1.6;
}

.pwa-install-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
}

.pwa-install-icon {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 5px 14px rgba(18, 50, 79, 0.18);
}

.pwa-platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  color: #176b69;
  font-size: 12px;
  font-weight: 800;
}

.pwa-platform-badge svg,
.pwa-install-note svg,
.pwa-install-x svg {
  width: 17px;
  height: 17px;
}

.pwa-install-x {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: #5f6e7f;
  background: #eef2f5;
  cursor: pointer;
}

.pwa-install-steps {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 17px 18px 17px 40px;
  border: 1px solid #dce4e9;
  border-radius: 8px;
  color: #354454;
  background: #f7f9fa;
  font-size: 14px;
  line-height: 1.55;
}

.pwa-install-steps li::marker {
  color: #176b69;
  font-weight: 800;
}

.pwa-install-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 20px;
  color: #5d6c7c;
  font-size: 12px;
  line-height: 1.5;
}

.pwa-install-note svg {
  flex: 0 0 auto;
  margin-top: 1px;
  color: #176b69;
}

.pwa-install-confirm {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #176b69;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.pwa-install-actions {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  gap: 8px;
}

.pwa-install-actions .pwa-install-confirm {
  min-width: 0;
}

.pwa-download-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
}

.pwa-download-link svg {
  width: 17px;
  height: 17px;
}

.pwa-install-secondary {
  min-height: 48px;
  border: 1px solid #d6e0e5;
  border-radius: 6px;
  color: #405463;
  background: #f5f8fa;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.pwa-dialog-fallback {
  position: fixed;
  inset: 0;
  z-index: 9999;
  margin: auto;
}

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

.app-download-actions {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.app-download-button {
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid #d9e2e7;
  border-radius: 5px;
  color: #23445b;
  background: #f7fafb;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.app-download-button svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.app-download-button.android:hover {
  color: #17635a;
  background: #eaf6f3;
  border-color: #9ccdc6;
}

.app-download-button.ios:hover {
  color: #142b3d;
  background: #edf2f5;
  border-color: #aebdc7;
}

.app-download-actions-sidebar .app-download-button {
  color: #c6d2dc;
  background: transparent;
  border-color: rgba(255, 255, 255, .14);
}

.app-download-actions-sidebar .app-download-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .28);
}

.app-download-actions-auth {
  margin-top: 8px;
}

@media (max-width: 760px) {
  .sidebar-bottom > .app-download-actions-sidebar {
    width: 100%;
    grid-column: 1 / 3;
  }

  .admin-sidebar-bottom {
    flex-wrap: wrap;
  }

  .admin-sidebar-bottom > .app-download-actions-sidebar {
    width: 100%;
    flex: 1 0 100%;
  }
}

@media (max-width: 640px) {
  .pwa-install-dialog {
    width: auto;
    max-height: calc(100dvh - 24px);
    inset: auto 8px max(8px, env(safe-area-inset-bottom));
    margin: 0;
    padding: 22px 18px max(20px, env(safe-area-inset-bottom));
  }

  .pwa-install-dialog h2 {
    margin-top: 16px;
    font-size: 20px;
  }

  .pwa-install-intro {
    font-size: 14px;
  }

  .pwa-install-steps {
    gap: 10px;
    padding: 15px 14px 15px 36px;
    font-size: 13px;
  }

  .pwa-install-actions {
    grid-template-columns: 1fr;
  }

}

@media (prefers-reduced-motion: no-preference) {
  .pwa-install-dialog[open] {
    animation: pwa-dialog-in 180ms ease-out;
  }

  @keyframes pwa-dialog-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
