:root {
  --opwa-navy: #071d3a;
  --opwa-blue: #176ef3;
  --opwa-cyan: #27c6e8;
  --opwa-green: #08a88a;
  --opwa-red: #d92d20;
}

#opwa-root,
#opwa-root * { box-sizing: border-box; }

#opwa-root {
  position: relative;
  z-index: 2147483000;
  font-family: Manrope, Poppins, Arial, sans-serif;
}

.opwa-install {
  position: fixed;
  z-index: 2147483001;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(460px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid rgba(125, 164, 214, .34);
  border-radius: 20px;
  background: rgba(255, 255, 255, .97);
  color: #0a1d39;
  box-shadow: 0 22px 65px rgba(5, 26, 61, .24);
  backdrop-filter: blur(18px);
  transform: translateY(130%);
  opacity: 0;
  pointer-events: none;
  transition: transform .28s ease, opacity .28s ease;
}

.opwa-install.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.opwa-install-logo {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  box-shadow: 0 8px 22px rgba(7, 29, 58, .2);
}

.opwa-install-copy { min-width: 0; }
.opwa-install-copy strong { display: block; font-size: 14px; line-height: 1.25; }
.opwa-install-copy span { display: block; margin-top: 3px; color: #64748b; font-size: 11px; line-height: 1.4; }
.opwa-install-actions { display: flex; align-items: center; gap: 8px; }

.opwa-button {
  min-height: 40px;
  border: 0;
  border-radius: 11px;
  padding: 0 15px;
  font: 800 12px/1 Manrope, Arial, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.opwa-button-primary {
  color: #fff;
  background: linear-gradient(135deg, #1268f3, #234ae8);
  box-shadow: 0 8px 20px rgba(23, 110, 243, .24);
}

.opwa-button-ghost { color: #52647d; background: #edf3fa; }
.opwa-button-secondary {
  width: 100%;
  min-height: 46px;
  margin-top: 9px;
  color: #17426f;
  background: #edf5ff;
  border: 1px solid #cfe1f7;
}
.opwa-button:focus-visible { outline: 3px solid rgba(39, 198, 232, .35); outline-offset: 2px; }

.opwa-permission-backdrop {
  position: fixed;
  z-index: 2147483002;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 16, 38, .82);
  backdrop-filter: blur(16px);
}

.opwa-permission-card {
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 26px;
  border: 1px solid rgba(151, 184, 225, .42);
  border-radius: 28px;
  background: #fff;
  color: #0a1d39;
  box-shadow: 0 32px 90px rgba(0, 10, 32, .38);
}

.opwa-permission-head { display: flex; align-items: center; gap: 15px; }
.opwa-permission-head img { width: 66px; height: 66px; border-radius: 18px; flex: 0 0 auto; }
.opwa-permission-head span { color: #176ef3; font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.opwa-permission-head h2 { margin: 6px 0 0; font-size: 25px; line-height: 1.14; letter-spacing: -.035em; }
.opwa-permission-intro { margin: 18px 0; color: #5d6f87; font-size: 13px; line-height: 1.65; }

.opwa-permission-list { display: grid; gap: 10px; margin: 0 0 18px; }
.opwa-permission-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid #dbe6f3;
  border-radius: 15px;
  background: #f7faff;
}

.opwa-permission-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #e8f1ff; color: #176ef3; font-size: 18px; }
.opwa-permission-row strong { display: block; font-size: 13px; }
.opwa-permission-row small { display: block; margin-top: 3px; color: #718096; font-size: 10px; line-height: 1.35; }
.opwa-status { max-width: 150px; padding: 6px 9px; border-radius: 999px; font-size: 9px; font-weight: 800; line-height: 1.25; text-align: center; white-space: normal; }
.opwa-status.good { color: #057a64; background: #ddf8f1; }
.opwa-status.warn { color: #9a5b00; background: #fff1d3; }
.opwa-status.bad { color: #b42318; background: #fee4e2; }

.opwa-permission-note {
  margin: 0 0 16px;
  padding: 11px 13px;
  border-radius: 13px;
  background: #fff7e7;
  color: #7a4b00;
  font-size: 11px;
  line-height: 1.5;
}

.opwa-permission-card .opwa-button-primary { width: 100%; min-height: 50px; font-size: 13px; }
.opwa-permission-links { display: flex; justify-content: center; gap: 16px; margin-top: 14px; }
.opwa-permission-links button,
.opwa-permission-links a { border: 0; padding: 0; background: transparent; color: #52647d; font: 700 11px/1.4 Manrope, Arial, sans-serif; text-decoration: none; cursor: pointer; }

.opwa-ios-help {
  margin-top: 14px;
  padding: 13px;
  border-radius: 13px;
  background: #edf5ff;
  color: #24405f;
  font-size: 11px;
  line-height: 1.55;
}

body.opwa-permission-locked { overflow: hidden !important; }

@media (max-width: 620px) {
  .opwa-install {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: auto;
    grid-template-columns: 48px minmax(0, 1fr);
    border-radius: 18px;
    padding: 11px;
  }
  .opwa-install-logo { width: 48px; height: 48px; border-radius: 13px; }
  .opwa-install-actions { grid-column: 1 / -1; width: 100%; }
  .opwa-install-actions .opwa-button { flex: 1; }
  .opwa-permission-backdrop { padding: 10px; }
  .opwa-permission-card { padding: 20px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px; }
  .opwa-permission-head img { width: 56px; height: 56px; border-radius: 16px; }
  .opwa-permission-head h2 { font-size: 21px; }
  .opwa-permission-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .opwa-install { transition: none; }
}
