.install-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.install-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.install-overlay.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.install-box {
  max-width: 380px;
  background: #202020;
  border-radius: 12px;
  padding: 28px 24px;
  box-shadow: 0 0 25px rgba(0,0,0,0.6);
  color: #f5f5f5;                 /* Light text for dark background */
  font-family: system-ui, sans-serif;
  text-align: center;
}

.install-box h2 {
  color: #ffffff;
  font-size: 1.25rem;
  margin-bottom: 0.5em;
}

.install-box p {
  color: #ddd;
  margin: 0.5em 0;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #444;
  border-radius: 5px;
  overflow: hidden;
  margin: 16px 0;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.4);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0a84ff, #40b3ff);
  transition: width 0.3s ease;
}

@keyframes pulse-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

#install-status {
  animation: pulse-text 1.5s infinite ease-in-out;
}

#pwa-bottom-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 10001;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #0a4b8f;
  color: #fff;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

#pwa-bottom-banner.is-busy {
  background: #073e75;
  box-shadow: 0 10px 34px rgba(0,0,0,.42);
}

#pwa-bottom-text {
  flex: 1 1 auto;
}

#pwa-bottom-install {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 108px;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 8px;
  background: #fff;
  color: #0a4b8f;
  cursor: pointer;
  font-weight: 700;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.12s ease;
}

#pwa-bottom-install:hover:not(:disabled) {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #073e75;
  box-shadow: 0 0 0 2px rgba(191,219,254,0.45), 0 4px 14px rgba(0,0,0,0.18);
  transform: translateY(-1px);
}

#pwa-bottom-install:active:not(:disabled) {
  background: #fde68a;
  border-color: #facc15;
  color: #172554;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.18);
  transform: translateY(0);
}

#pwa-bottom-install:focus-visible {
  outline: 3px solid rgba(255,255,255,0.88);
  outline-offset: 3px;
}

#pwa-bottom-install:disabled {
  cursor: progress;
}

#pwa-bottom-install.is-loading {
  background: #e8f1ff;
  border-color: #bfdbfe;
  color: #073e75;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}

.pwa-install-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: pwa-install-spin 0.8s linear infinite;
}

#pwa-bottom-install.is-loading .pwa-install-spinner {
  display: inline-block;
}

@keyframes pwa-install-spin {
  to { transform: rotate(360deg); }
}

#pwa-bottom-close {
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  border-radius: 6px;
  padding: 4px 8px;
  transition: background-color 0.16s ease, transform 0.12s ease;
}

#pwa-bottom-close:hover {
  background: rgba(255,255,255,0.18);
}

#pwa-bottom-close:active {
  background: rgba(255,255,255,0.28);
  transform: scale(0.95);
}
