.pwa-prompt,
.pwa-offline-badge,
.pwa-install {
  position: fixed;
  z-index: 10000;
  box-sizing: border-box;
  font-family: Pretendard, "Noto Sans KR", system-ui, sans-serif;
  box-shadow: 0 18px 50px rgba(4, 43, 35, 0.24);
}

.pwa-install {
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  width: min(440px, calc(100vw - 40px));
  padding: 11px 11px 11px 12px;
  color: #173c34;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #d8e7e1;
  border-radius: 16px;
  backdrop-filter: blur(14px);
  animation: pwa-prompt-in 180ms ease-out;
}

.pwa-install__mark { display: block; width: 38px; height: 38px; border-radius: 10px; }
.pwa-install__copy { display: grid; gap: 2px; min-width: 0; }
.pwa-install__copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.pwa-install__copy span { color: #647b75; font-size: 11px; line-height: 1.45; }

.pwa-install__button {
  min-height: 36px;
  padding: 0 13px;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  background: #0b6655;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.pwa-install__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: #71857f;
  font: 400 21px/1 system-ui, sans-serif;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.pwa-install__button:hover { background: #084f43; }
.pwa-install__close:hover { color: #173c34; background: #edf4f1; }
.pwa-install__button:focus-visible,
.pwa-install__close:focus-visible { outline: 3px solid rgba(11, 102, 85, 0.28); outline-offset: 2px; }
.pwa-install__button:disabled { cursor: wait; opacity: 0.66; }

.pwa-prompt {
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(520px, calc(100vw - 40px));
  padding: 16px;
  color: #fff;
  background: #083c32;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  animation: pwa-prompt-in 180ms ease-out;
}

.pwa-prompt__copy {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.pwa-prompt__copy strong { font-size: 14px; }
.pwa-prompt__copy span { color: #cfe2dc; font-size: 12px; line-height: 1.5; }
.pwa-prompt__actions { display: flex; gap: 8px; }

.pwa-prompt__button {
  min-height: 38px;
  padding: 0 13px;
  color: #e6f1ed;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  cursor: pointer;
}

.pwa-prompt__button--primary { color: #083c32; background: #80e0bf; border-color: #80e0bf; }
.pwa-prompt__button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.pwa-prompt__button:disabled { cursor: wait; opacity: 0.66; }

.pwa-offline-badge {
  left: max(20px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 40px);
  padding: 10px 14px;
  color: #6d4f04;
  font-size: 12px;
  font-weight: 700;
  background: #fff3cd;
  border: 1px solid #edd289;
  border-radius: 999px;
}

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

@media (max-width: 620px) {
  .pwa-prompt { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; width: auto; align-items: stretch; flex-direction: column; }
  .pwa-prompt__actions { justify-content: flex-end; }
  .pwa-offline-badge { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; text-align: center; }
  .pwa-install { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px; width: auto; }
  .pwa-install__copy span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-prompt { animation: none; }
}
