/*
 * NiL= PWA UI — preserve the existing editorial salon palette and
 * introduce UI only when the browser offers installation or connectivity changes.
 */
.pwa-install-banner {
  position: fixed;
  z-index: 1000;
  top: 50%;
  left: 50%;
  width: min(22rem, calc(100vw - 2rem));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.8rem;
  margin: 0;
  padding: 2rem 1.1rem 1.1rem;
  color: #4c4951;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #dedce0;
  box-shadow: 0 14px 34px rgba(76, 73, 81, 0.18);
  animation: nil-pwa-enter 220ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

.pwa-install-banner__copy {
  display: grid;
  gap: 0.25rem;
  line-height: 1.45;
}

.pwa-install-banner__copy strong {
  font-size: 0.9rem;
  font-weight: 700;
}

.pwa-install-banner__copy span {
  color: #77747c;
  font-size: 0.78rem;
}

.pwa-install-banner__actions {
  width: 100%;
  display: grid;
  justify-items: stretch;
}

.pwa-install-banner button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.pwa-install-banner__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 2rem;
  min-height: 2rem;
  padding: 0;
  display: grid;
  place-items: center;
  color: #8c8990;
  background: transparent;
  border-radius: 50%;
  font-size: 1.35rem;
  line-height: 1;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.pwa-install-banner__close:hover,
.pwa-install-banner__close:focus-visible {
  color: #a9708c;
  background: #f5e7ed;
}

.pwa-install-banner__close:active {
  transform: scale(0.92);
}

.pwa-install-banner__install {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.45rem 0.8rem;
  color: #fff;
  background: #c96894;
  transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background 160ms ease;
}

.pwa-install-banner__install:hover,
.pwa-install-banner__install:focus-visible {
  background: #a9708c;
}

.pwa-install-banner__install:active {
  transform: scale(0.97);
}

html.is-offline::after {
  content: 'オフラインです。表示済みのページを利用できます。';
  position: fixed;
  z-index: 1001;
  top: 0;
  right: 0;
  left: 0;
  padding: calc(0.55rem + env(safe-area-inset-top)) 1rem 0.55rem;
  color: #fff;
  background: #59575e;
  font-size: 0.76rem;
  text-align: center;
}

@keyframes nil-pwa-enter {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 0.75rem)); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@media (max-width: 430px) {
  .pwa-install-banner {
    width: calc(100vw - 2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install-banner,
  .pwa-install-banner__install,
  .pwa-install-banner__close {
    animation: none;
    transition: none;
  }
}

/* Dim the site behind the install prompt while keeping reservation actions available. */
.pwa-install-backdrop {
  position: fixed;
  z-index: 999;
  inset: 0;
  background: rgba(38, 35, 42, 0.60);
  animation: nil-pwa-backdrop-enter 180ms ease both;
}

.pwa-install-banner {
  z-index: 1000;
}

/* Reservation actions stay bright and clickable above the dimming layer. */
body.has-install-overlay .app-side-booking-wrap,
body.has-install-overlay .fixed-booking-wrap {
  z-index: 1001;
}

@keyframes nil-pwa-backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

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