.life-pwa-banner {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(env(safe-area-inset-bottom) + 84px);
  z-index: 1200;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: min(420px, calc(100vw - 24px));
  padding: 18px 18px 16px;
  border: 1px solid rgba(101, 212, 244, 0.32);
  border-radius: 28px;
  background:
    radial-gradient(118% 120% at 14% 12%, rgba(255, 221, 194, 0.58), rgba(255, 221, 194, 0) 48%),
    radial-gradient(88% 92% at 84% 18%, rgba(181, 237, 249, 0.34), rgba(181, 237, 249, 0) 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(251, 248, 243, 0.98) 100%);
  box-shadow:
    0 24px 54px rgba(85, 186, 221, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

.life-pwa-banner[hidden] {
  display: none !important;
}

.life-pwa-banner::before,
.life-pwa-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.life-pwa-banner::before {
  background:
    linear-gradient(138deg, rgba(255, 198, 167, 0.18) 0 1px, transparent 1px 38px),
    linear-gradient(44deg, rgba(144, 225, 246, 0.16) 0 1px, transparent 1px 44px);
  opacity: 0.4;
  animation: life-pwa-structure-flow 18s ease-in-out infinite alternate;
}

.life-pwa-banner::after {
  inset: -22% -10% auto auto;
  width: 240px;
  height: 220px;
  border-radius: 46% 54% 58% 42%;
  background: radial-gradient(circle, rgba(137, 227, 255, 0.28) 0%, rgba(137, 227, 255, 0) 72%);
  filter: blur(10px);
  opacity: 0.8;
  animation: life-pwa-sunset-glow 16s ease-in-out infinite alternate;
}

.life-pwa-banner__wire {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.44;
}

.life-pwa-banner__wire svg {
  width: 100%;
  height: 100%;
}

.life-pwa-banner__wire path,
.life-pwa-banner__wire line {
  fill: none;
  stroke: rgba(141, 182, 197, 0.28);
  stroke-width: 1.15;
  stroke-linecap: round;
}

.life-pwa-banner__wire circle {
  fill: rgba(255, 197, 170, 0.34);
}

.life-pwa-badge,
.life-pwa-copy,
.life-pwa-actions,
.life-pwa-close {
  position: relative;
  z-index: 1;
}

.life-pwa-badge {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(248, 245, 240, 0.95)),
    linear-gradient(135deg, rgba(255, 219, 190, 0.24), rgba(134, 229, 248, 0.16));
  border: 1px solid rgba(106, 211, 242, 0.26);
  box-shadow:
    0 12px 24px rgba(99, 196, 228, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.life-pwa-badge img {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: block;
}

.life-pwa-copy {
  min-width: 0;
}

.life-pwa-kicker {
  margin: 0 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7bb3c2;
}

.life-pwa-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 800;
  color: #55798a;
}

.life-pwa-desc {
  margin: 6px 0 0;
  font-size: 0.88rem;
  line-height: 1.7;
  color: #6c8f9e;
}

.life-pwa-steps {
  margin: 10px 0 0;
  padding-left: 1.2rem;
  color: #6b8c9b;
  font-size: 0.82rem;
  line-height: 1.75;
}

.life-pwa-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 2px;
}

.life-pwa-action {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.78rem 1rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.life-pwa-action:hover {
  transform: translateY(-1px);
}

.life-pwa-action:active {
  transform: translateY(0);
}

.life-pwa-action--primary {
  color: #ffffff;
  background: linear-gradient(135deg, #ffcaa8 0%, #ffbfb5 34%, #7edfff 100%);
  box-shadow: 0 10px 22px rgba(203, 164, 147, 0.24);
}

.life-pwa-action--ghost {
  color: #6b93a2;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(107, 211, 242, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.life-pwa-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #82a7b5;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

@keyframes life-pwa-structure-flow {
  0% {
    transform: translate3d(-1%, 0, 0) scale(0.99);
    opacity: 0.34;
  }
  100% {
    transform: translate3d(1.5%, -1.5%, 0) scale(1.03);
    opacity: 0.46;
  }
}

@keyframes life-pwa-sunset-glow {
  0% {
    transform: translate3d(-3%, 0, 0) scale(0.98);
  }
  100% {
    transform: translate3d(3%, 2%, 0) scale(1.06);
  }
}

.life-standalone-app,
.life-standalone-app body {
  background: linear-gradient(180deg, #eefaff 0%, #f7fdff 56%, #eef9ff 100%);
}

html.life-pwa-booting,
html.life-pwa-booting body {
  min-height: 100%;
  background:
    radial-gradient(78% 62% at 16% 16%, rgba(173, 237, 255, 0.34), transparent 68%),
    radial-gradient(52% 42% at 84% 14%, rgba(193, 241, 255, 0.42), transparent 70%),
    linear-gradient(180deg, #edfaff 0%, #f8fdff 52%, #eef8ff 100%);
}

html.life-pwa-booting body {
  overflow: hidden;
}

html.life-pwa-booting body::before,
html.life-pwa-booting body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2200;
  pointer-events: none;
}

html.life-pwa-booting body::before {
  background:
    radial-gradient(54% 44% at 18% 18%, rgba(168, 235, 255, 0.34), transparent 74%),
    radial-gradient(32% 26% at 80% 18%, rgba(202, 244, 255, 0.4), transparent 72%),
    linear-gradient(138deg, rgba(129, 214, 246, 0.15) 0 1px, transparent 1px 48px),
    linear-gradient(42deg, rgba(112, 198, 231, 0.12) 0 1px, transparent 1px 56px),
    linear-gradient(180deg, rgba(238, 250, 255, 0.98) 0%, rgba(247, 253, 255, 0.98) 100%);
  opacity: 1;
  animation: life-pwa-boot-ambient 1.8s ease-in-out infinite alternate;
}

html.life-pwa-booting body::after {
  content: "ぽてライフ\A LIFE ORGANIZER";
  inset: auto;
  left: 50%;
  top: 50%;
  width: min(292px, calc(100vw - 40px));
  padding: 122px 24px 28px;
  border-radius: 34px;
  border: 1px solid rgba(113, 210, 241, 0.24);
  background:
    radial-gradient(120% 120% at 20% 18%, rgba(170, 237, 255, 0.3), rgba(170, 237, 255, 0) 44%),
    radial-gradient(84% 72% at 82% 20%, rgba(207, 245, 255, 0.44), rgba(207, 245, 255, 0) 56%),
    linear-gradient(148deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 255, 0.96));
  background-image:
    radial-gradient(120% 120% at 20% 18%, rgba(170, 237, 255, 0.3), rgba(170, 237, 255, 0) 44%),
    radial-gradient(84% 72% at 82% 20%, rgba(207, 245, 255, 0.44), rgba(207, 245, 255, 0) 56%),
    url("/icon/pwa-192.png"),
    linear-gradient(148deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 255, 0.96));
  background-repeat: no-repeat;
  background-size: auto, auto, 76px 76px, auto;
  background-position: 0 0, 0 0, center 28px, 0 0;
  box-shadow:
    0 26px 60px rgba(105, 191, 218, 0.22),
    0 8px 18px rgba(127, 205, 229, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  transform: translate(-50%, -50%);
  white-space: pre;
  text-align: center;
  font-family: "Zen Maru Gothic", "Noto Sans JP", sans-serif;
  font-size: 1.06rem;
  line-height: 1.82;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: #5f8da0;
  animation: life-pwa-boot-card 0.82s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.life-pwa-ready body::before,
.life-pwa-ready body::after {
  animation: none;
}

@media (max-width: 768px) {
  html.life-pwa-booting body::after {
    width: min(272px, calc(100vw - 28px));
    padding: 112px 20px 24px;
    border-radius: 30px;
    background-size: auto, auto, 68px 68px, auto;
    background-position: 0 0, 0 0, center 24px, 0 0;
    font-size: 0.98rem;
    letter-spacing: 0.1em;
  }

  .life-pwa-banner {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: calc(var(--life-nav-height) + env(safe-area-inset-bottom, 0px) + 34px);
    width: min(368px, calc(100vw - 24px));
    max-height: min(62vh, 392px);
    padding: 14px 14px 12px;
    border-radius: 24px;
    overflow: auto;
    overscroll-behavior: contain;
  }

  .life-pwa-badge {
    width: 52px;
    height: 52px;
    border-radius: 17px;
  }

  .life-pwa-badge img {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .life-pwa-actions {
    justify-content: stretch;
    gap: 8px;
  }

  .life-pwa-action {
    flex: 1 1 0;
    text-align: center;
    padding: 0.7rem 0.84rem;
    font-size: 0.81rem;
  }
}

@media (max-width: 520px) {
  .life-pwa-banner {
    grid-template-columns: auto 1fr;
    width: min(352px, calc(100vw - 20px));
    bottom: calc(var(--life-nav-height) + env(safe-area-inset-bottom, 0px) + 36px);
  }

  .life-pwa-title {
    font-size: 0.94rem;
  }

  .life-pwa-desc {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .life-pwa-steps {
    font-size: 0.76rem;
    line-height: 1.62;
  }

  .life-pwa-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (display-mode: standalone) {
  .life-pwa-banner {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.life-pwa-booting body::before,
  html.life-pwa-booting body::after,
  .life-pwa-banner::before,
  .life-pwa-banner::after {
    animation: none !important;
  }
}

@keyframes life-pwa-boot-card {
  0% {
    transform: translate(-50%, calc(-50% + 16px)) scale(0.94);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes life-pwa-boot-ambient {
  0% {
    transform: scale(1) translate3d(0, 0, 0);
    opacity: 0.96;
  }
  100% {
    transform: scale(1.03) translate3d(0, -0.6%, 0);
    opacity: 1;
  }
}
