/* REV22 R1 — Web Push & Notification Subscription.
   Fully scoped. No global overrides. */

.sb-push-launcher {
  --sb-push-bg: rgba(3, 20, 38, 0.96);
  --sb-push-line: rgba(74, 176, 221, 0.34);
  --sb-push-gold: #ffb51b;
  --sb-push-cyan: #22c5ee;
  --sb-push-text: #f7fbff;
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(86px, calc(env(safe-area-inset-bottom) + 86px));
  z-index: 2147482300;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--sb-push-line);
  border-radius: 999px;
  padding: 8px 12px 8px 10px;
  background: linear-gradient(145deg, rgba(4, 30, 49, 0.97), var(--sb-push-bg));
  color: var(--sb-push-text);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font: 800 12px/1.2 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.sb-push-launcher:hover,
.sb-push-launcher:focus-visible {
  outline: none;
  transform: translateY(-2px);
  border-color: rgba(255, 208, 77, 0.62);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}

.sb-push-launcher-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(34, 197, 238, 0.12);
}

.sb-push-launcher-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #91a9bc;
}

.sb-push-launcher[data-state="active"] .sb-push-launcher-dot {
  background: #45e49a;
}

.sb-push-launcher[data-state="blocked"] .sb-push-launcher-dot,
.sb-push-launcher[data-state="unsupported"] .sb-push-launcher-dot {
  background: #ff7b7b;
}

.sb-push-launcher[data-state="install"] .sb-push-launcher-dot {
  background: #ffd04d;
}

.sb-push-panel[hidden] {
  display: none !important;
}

.sb-push-panel {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(142px, calc(env(safe-area-inset-bottom) + 142px));
  z-index: 2147482350;
  width: min(380px, calc(100vw - 36px));
  color: #f7fbff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  opacity: 0;
  transform: translateY(12px) scale(.99);
  transform-origin: left bottom;
  transition: opacity .2s ease, transform .2s ease;
}

.sb-push-panel.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.sb-push-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(74, 176, 221, .32);
  border-radius: 20px;
  padding: 18px;
  background:
    radial-gradient(circle at 94% 0%, rgba(34, 197, 238, .16), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(255, 181, 27, .12), transparent 38%),
    linear-gradient(145deg, rgba(4, 30, 49, .97), rgba(3, 20, 38, .97));
  box-shadow: 0 24px 65px rgba(0, 0, 0, .5);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.sb-push-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 68%;
  height: 2px;
  background: linear-gradient(90deg, #22c5ee, #ffb51b, transparent);
}

.sb-push-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(140, 192, 217, .23);
  border-radius: 50%;
  padding: 0;
  background: rgba(2, 15, 28, .74);
  color: #c9d8e3;
  font: inherit;
  font-size: 21px;
  cursor: pointer;
}

.sb-push-close:hover,
.sb-push-close:focus-visible {
  outline: none;
  color: #ffd04d;
  border-color: rgba(255, 208, 77, .68);
}

.sb-push-kicker {
  display: block;
  padding-right: 40px;
  color: #22c5ee;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.sb-push-title {
  margin: 8px 38px 8px 0;
  color: #f7fbff;
  font-size: clamp(19px, 4vw, 23px);
  line-height: 1.2;
}

.sb-push-copy {
  margin: 0;
  color: #c8d6e3;
  font-size: 12.5px;
  line-height: 1.58;
}

.sb-push-status-row {
  margin-top: 14px;
  display: flex;
}

.sb-push-status-badge {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(145, 169, 188, .24);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(145, 169, 188, .08);
  color: #91a9bc;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.sb-push-status-badge[data-state="active"] {
  color: #7ff0b9;
  border-color: rgba(69, 228, 154, .34);
  background: rgba(69, 228, 154, .09);
}

.sb-push-status-badge[data-state="blocked"],
.sb-push-status-badge[data-state="unsupported"] {
  color: #ffaaaa;
  border-color: rgba(255, 123, 123, .32);
  background: rgba(255, 123, 123, .08);
}

.sb-push-status-badge[data-state="install"] {
  color: #ffd04d;
  border-color: rgba(255, 208, 77, .34);
  background: rgba(255, 208, 77, .08);
}

.sb-push-status-text {
  min-height: 38px;
  margin: 9px 0 0;
  color: #c8d6e3;
  font-size: 11px;
  line-height: 1.55;
}

.sb-push-primary {
  width: 100%;
  min-height: 44px;
  margin-top: 13px;
  border: 1px solid #ffcf43;
  border-radius: 13px;
  padding: 10px 15px;
  background: linear-gradient(180deg, #ffd04d, #ffb51b);
  color: #07131c;
  font: 900 12.5px/1.2 Inter, system-ui, sans-serif;
  cursor: pointer;
}

.sb-push-primary:disabled {
  opacity: .66;
  cursor: default;
}

.sb-push-panel[data-state="active"] .sb-push-primary {
  border-color: rgba(113, 205, 255, .42);
  background: rgba(13, 59, 84, .92);
  color: #dff6ff;
}

.sb-push-privacy {
  margin: 10px 0 0;
  color: #91a9bc;
  font-size: 9.8px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .sb-push-launcher {
    left: max(10px, env(safe-area-inset-left));
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 78px));
    width: 44px;
    padding: 7px;
    justify-content: center;
  }

  .sb-push-launcher-text {
    display: none;
  }

  .sb-push-launcher-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
  }

  .sb-push-panel {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(134px, calc(env(safe-area-inset-bottom) + 134px));
    width: auto;
  }

  .sb-push-card {
    max-height: calc(100dvh - 96px);
    overflow-y: auto;
    border-radius: 18px;
    padding: 16px;
  }
}


/* REV22 R3 — keep the notification control out of the way
   while the premium REV21 install card is actively visible. */
body:has(.sb-pwa-install.is-visible) .sb-push-launcher,
body:has(.sb-pwa-install.is-visible) .sb-push-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .sb-push-launcher,
  .sb-push-panel {
    transition: none;
  }
}

@media print {
  .sb-push-launcher,
  .sb-push-panel {
    display: none !important;
  }
}

/* REV22 R3.3 — in-page banner only while the homepage is visible.
   Existing Android/Windows notification channels remain unchanged. */
.sb-push-foreground[hidden] { display: none !important; }
.sb-push-foreground {
  position: fixed;
  top: max(12px, calc(env(safe-area-inset-top) + 12px));
  right: max(12px, env(safe-area-inset-right));
  z-index: 2147482450;
  width: min(410px, calc(100vw - 24px));
  max-height: min(220px, 50dvh);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: start;
  padding: 16px 13px 14px;
  overflow: auto;
  border: 1px solid rgba(74, 176, 221, .52);
  border-radius: 17px;
  background: linear-gradient(142deg, #082e44, #031426);
  color: #f7fbff;
  box-shadow: 0 20px 48px rgba(0, 0, 0, .45);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  animation: sb-push-foreground-in .22s ease-out;
}
.sb-push-foreground::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 70%;
  height: 2px;
  background: linear-gradient(90deg, #22c5ee, #ffb51b, transparent);
}
.sb-push-foreground-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(34, 197, 238, .15);
  font-size: 18px;
}
.sb-push-foreground-copy { min-width: 0; }
.sb-push-foreground-title {
  display: block;
  margin: 1px 0 6px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.sb-push-foreground-body {
  margin: 0;
  color: #c9dbe5;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.sb-push-foreground-close {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(140, 192, 217, .32);
  border-radius: 50%;
  background: rgba(2, 15, 28, .68);
  color: #e6f6ff;
  font: 22px/1 system-ui, sans-serif;
  cursor: pointer;
}
.sb-push-foreground-link {
  grid-column: 2 / 3;
  justify-self: start;
  margin-top: -1px;
  color: #ffd04d;
  text-decoration: underline;
  text-underline-offset: 3px;
  font: 700 11px/1.4 Inter, system-ui, sans-serif;
}
.sb-push-foreground-close:focus-visible,
.sb-push-foreground-link:focus-visible { outline: 2px solid #ffd04d; outline-offset: 2px; }
@keyframes sb-push-foreground-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .sb-push-foreground { animation: none; }
}
@media print {
  .sb-push-foreground { display: none !important; }
}

/* REV22 R3.4 — no persistent floating bell after verified activation.
   Footer opt-out remains available without disturbing existing layouts. */
.sb-push-launcher[hidden],
.sb-push-manage-link[hidden] { display: none !important; }
.sb-push-manage-link {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.sb-push-manage-link:hover,
.sb-push-manage-link:focus-visible { color: #ffcf43; }
