:root {
  background: #f4f8ff;
}

:root[data-display-mode="standalone"] {
  min-height: 100%;
  background: #f4f8ff;
}

:root[data-display-mode="standalone"] body {
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

:root[data-pwa-access="install-required"] body {
  overflow: hidden;
}

.pwa-install-gate {
  position: fixed;
  z-index: 2147483200;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding:
    max(24px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 10% 5%, rgb(255 255 255 / 96%) 0, rgb(255 255 255 / 0%) 34%),
    radial-gradient(circle at 95% 95%, #e2edff 0, rgb(226 237 255 / 0%) 42%),
    linear-gradient(150deg, #fffefe 0%, #edf5ff 55%, #f9fbff 100%);
  color: #172033;
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pwa-install-gate-panel {
  display: grid;
  width: min(440px, 100%);
  gap: 18px;
  padding: 28px 24px 24px;
  border: 1px solid #dbe6f3;
  border-radius: 28px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 26px 80px rgb(43 72 110 / 18%);
}

.pwa-install-gate-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #173f87;
}

.pwa-install-gate-brand strong {
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.pwa-install-gate-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #71b8ff, #3371ff);
  box-shadow: 0 10px 26px rgb(51 113 255 / 24%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 900;
}

.pwa-install-gate-eyebrow {
  margin-bottom: -10px;
  color: #3972d3;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.pwa-install-gate h1 {
  margin: 0;
  color: #172033;
  font-size: clamp(29px, 8vw, 38px);
  font-weight: 880;
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.pwa-install-gate #pwa-install-gate-description {
  margin: -6px 0 0;
  color: #607089;
  font-size: 15px;
  line-height: 1.58;
}

.pwa-install-gate-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  counter-reset: install-step;
  list-style: none;
}

.pwa-install-gate-steps li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 15px;
  background: #f3f7fd;
  color: #30425b;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.45;
  counter-increment: install-step;
}

.pwa-install-gate-steps li::before {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: #e1ecff;
  color: #326be6;
  content: counter(install-step);
  font-size: 13px;
  font-weight: 900;
}

.pwa-install-gate-action {
  appearance: none;
  min-height: 52px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #5a8ff0, #376ed3);
  box-shadow: 0 12px 26px rgb(55 110 211 / 24%);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
}

.pwa-install-gate-action:focus-visible {
  outline: 3px solid rgb(50 107 230 / 30%);
  outline-offset: 3px;
}

.pwa-install-gate-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.pwa-browser-open {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.pwa-open-browser-action {
  appearance: none;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 10px 16px;
  border: 1px solid #b9cde9;
  border-radius: 15px;
  background: #edf4ff;
  color: #234b80;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}

.pwa-open-browser-icon {
  flex: none;
  font-size: 23px;
  line-height: 1;
}

.pwa-open-browser-action:focus-visible {
  outline: 3px solid rgb(50 107 230 / 30%);
  outline-offset: 3px;
}

.pwa-open-browser-hint {
  margin: 0;
  color: #607089;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.pwa-install-gate-status {
  margin: 5px 0 0;
  color: #607089;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  text-align: left;
}

.pwa-install-progress { display:flex; align-items:flex-start; gap:12px; padding:14px; border:1px solid #dce8f6; border-radius:15px; background:#f5f8fd; }
.pwa-install-progress > div { min-width:0; }
.pwa-install-progress strong { color:#315479; font-size:14px; line-height:1.4; }
.pwa-install-progress-indicator { flex:none; box-sizing:border-box; width:22px; height:22px; margin-top:1px; border:2px solid #b7cee9; border-radius:50%; }
.pwa-install-gate:is([data-pwa-install-state="prompting"], [data-pwa-install-state="installing"]) .pwa-install-progress-indicator { border-top-color:#326be6; animation:pwa-install-spin .8s linear infinite; }
.pwa-install-gate[data-pwa-install-state="installed"] .pwa-install-progress { border-color:#bce0cb; background:#eff9f3; }
.pwa-install-gate[data-pwa-install-state="installed"] .pwa-install-progress-indicator { display:grid; place-items:center; border-color:#2e8b58; background:#2e8b58; color:white; }
.pwa-install-gate[data-pwa-install-state="installed"] .pwa-install-progress-indicator::after { content:"✓"; font-size:14px; font-weight:800; }
.pwa-install-gate[data-pwa-install-state="installed"] .pwa-install-progress strong { color:#24764a; }
.pwa-install-gate[data-pwa-install-state="installed"] .pwa-install-gate-action:disabled { cursor:default; opacity:1; background:#2e8055; box-shadow:none; }
@keyframes pwa-install-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pwa-install-progress-indicator { animation:none !important; } }

.pwa-install-gate[data-pwa-install-state="installed"] .pwa-install-gate-status {
  color: #24764a;
}

.pwa-install-banner {
  position: fixed;
  z-index: 2147483000;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: min(620px, calc(100% - max(24px, env(safe-area-inset-left)) - max(24px, env(safe-area-inset-right))));
  margin: 0 auto;
  padding: 14px 14px 14px 18px;
  border: 1px solid #dbe5f1;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 60px rgb(43 72 110 / 20%);
  color: #172033;
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pwa-install-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.pwa-install-copy strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pwa-install-copy span {
  color: #607089;
  font-size: 12px;
  line-height: 1.4;
}

.pwa-install-action,
.pwa-install-close {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.pwa-install-action {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  background: #326be6;
  color: #ffffff;
  box-shadow: 0 7px 18px rgb(50 107 230 / 24%);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.pwa-install-action:focus-visible,
.pwa-install-close:focus-visible {
  outline: 3px solid rgb(50 107 230 / 30%);
  outline-offset: 2px;
}

.pwa-install-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.pwa-install-guide-backdrop {
  position: fixed;
  z-index: 2147483300;
  inset: 0;
  display: grid;
  align-items: end;
  padding: 18px max(12px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgb(13 25 43 / 38%);
  backdrop-filter: blur(3px);
}

.pwa-install-guide {
  position: relative;
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 22px 20px 18px;
  border: 1px solid #dbe5f1;
  border-radius: 24px;
  outline: 0;
  background: #ffffff;
  box-shadow: 0 24px 80px rgb(17 40 72 / 28%);
  color: #172033;
  font-family: Inter, Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pwa-install-guide::after {
  position: absolute;
  bottom: -11px;
  left: 50%;
  width: 20px;
  height: 20px;
  border-right: 1px solid #dbe5f1;
  border-bottom: 1px solid #dbe5f1;
  background: #ffffff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.pwa-install-guide strong {
  display: block;
  padding-right: 38px;
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.pwa-install-guide p {
  margin: 7px 0 15px;
  color: #607089;
  font-size: 14px;
  line-height: 1.5;
}

.pwa-install-guide .pwa-install-guide-fallback {
  margin: -3px 0 15px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef5ff;
  color: #2c568d;
  font-size: 13px;
  font-weight: 700;
}

.pwa-install-guide-backdrop[data-pwa-browser="in-app"] .pwa-install-guide-fallback,
.pwa-install-guide-backdrop[data-pwa-browser="android-in-app"] .pwa-install-guide-fallback {
  border: 1px solid #bcd2f5;
  background: #e6f0ff;
  color: #173f87;
  font-size: 14px;
  font-weight: 850;
}

.pwa-install-guide-backdrop[data-pwa-browser="in-app"] .pwa-install-guide::after,
.pwa-install-guide-backdrop[data-pwa-browser="android-in-app"] .pwa-install-guide::after {
  right: 26px;
  left: auto;
  transform: rotate(45deg);
}

.pwa-install-guide ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style-position: inside;
}

.pwa-install-guide li {
  padding: 11px 12px;
  border-radius: 12px;
  background: #f4f7fb;
  color: #30425b;
  font-size: 14px;
  font-weight: 700;
}

.pwa-install-guide-close,
.pwa-install-guide-done {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.pwa-install-guide-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #edf3fa;
  color: #50627a;
  font-size: 24px;
  line-height: 1;
}

.pwa-install-guide-done {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 46px;
  margin-top: 15px;
  border-radius: 13px;
  background: #326be6;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.pwa-install-guide-close:focus-visible,
.pwa-install-guide-done:focus-visible {
  outline: 3px solid rgb(50 107 230 / 30%);
  outline-offset: 2px;
}

.pwa-install-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #edf3fa;
  color: #50627a;
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 520px) {
  .pwa-install-gate {
    place-items: start center;
    padding-top: max(20px, env(safe-area-inset-top));
  }

  .pwa-install-gate-panel {
    gap: 16px;
    padding: 24px 18px 20px;
    border-radius: 24px;
  }

  .pwa-install-banner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 10px;
    padding: 13px 12px 13px 16px;
  }

  .pwa-install-action {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .pwa-install-close {
    grid-column: 2;
    grid-row: 1;
  }
}

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