/* Story Nest visible service-worker update prompt.
   The prompt lives inside the reading text plane, so its 50%/50%
   position is relative to that plane rather than the whole viewport. */
.sn-update-banner {
  position: absolute !important;
  left: 50%;
  top: 50%;
  bottom: auto;
  z-index: 100020;
  width: min(620px, calc(100% - 28px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 13px 12px 14px;
  border: 1px solid rgba(77, 139, 95, .36);
  border-radius: 20px;
  background: rgba(251, 255, 247, .96);
  color: #244835;
  box-shadow: 0 15px 38px rgba(31, 72, 51, .22);
  transform: translate(-50%, calc(-50% + 18px)) scale(.985);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  transition: opacity 180ms ease, transform 220ms ease, visibility 180ms ease;
}

.sn-update-banner[hidden] {
  display: none !important;
}

.sn-update-banner.is-visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.sn-update-banner-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, #effadf, #d9f0ca);
  box-shadow: inset 0 0 0 1px rgba(71, 130, 83, .12);
  font-size: 1.35rem;
}

.sn-update-banner-copy {
  min-width: 0;
}

.sn-update-banner-copy strong,
.sn-update-banner-copy span {
  display: block;
}

.sn-update-banner-copy strong {
  margin: 0;
  font: 900 .96rem/1.2 "Nunito", system-ui, sans-serif;
  color: #204d35;
}

.sn-update-banner-copy span {
  margin-top: 2px;
  font: 700 .78rem/1.25 "Nunito", system-ui, sans-serif;
  color: #557261;
}

.sn-update-button {
  min-height: 42px;
  padding: 9px 15px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, #328a55, #267846);
  color: #fff;
  box-shadow: 0 7px 17px rgba(31, 111, 65, .22);
  font: 900 .84rem/1 "Nunito", system-ui, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.sn-update-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 20px rgba(31, 111, 65, .27);
}

.sn-update-button:focus-visible {
  outline: 3px solid rgba(55, 130, 79, .32);
  outline-offset: 3px;
}

.sn-update-button:disabled {
  cursor: wait;
  opacity: .72;
  transform: none;
}

html[data-sn-theme="dark"] .sn-update-banner {
  border-color: rgba(157, 216, 175, .28);
  background: rgba(24, 47, 57, .97);
  color: #eef9f0;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .38);
}

html[data-sn-theme="dark"] .sn-update-banner-icon {
  background: linear-gradient(145deg, #244d3d, #1f4037);
  box-shadow: inset 0 0 0 1px rgba(180, 232, 196, .13);
}

html[data-sn-theme="dark"] .sn-update-banner-copy strong {
  color: #eef9f0;
}

html[data-sn-theme="dark"] .sn-update-banner-copy span {
  color: #c3d9ca;
}

@media (max-width: 560px) {
  .sn-update-banner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 11px;
    padding: 12px;
    border-radius: 18px;
  }

  .sn-update-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sn-update-banner,
  .sn-update-button {
    transition: none !important;
  }
}

/* Keep the notice above reading text and the decorative garden layer. */
.sn-story-card-v3 .sn-passage-shell > .sn-update-banner,
.sn-story-card-v3 .sn-passage-shell-v3 > .sn-update-banner {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  z-index: 60 !important;
}

@media (max-width: 640px) {
  .sn-story-card-v3 .sn-passage-shell > .sn-update-banner,
  .sn-story-card-v3 .sn-passage-shell-v3 > .sn-update-banner {
    width: calc(100% - 20px);
  }
}
