/* SecureKy What’s-new tour + live version overlay */

body.version-tour-open {
  overflow: hidden;
}

body.version-tour-compact {
  /* padding set inline from sheet height */
}

/* Live reload overlay */
.version-live {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 10, 14, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.version-live.is-visible {
  opacity: 1;
}

.version-live__card {
  width: min(420px, 100%);
  background: linear-gradient(165deg, #1e2128 0%, #14161b 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 1.35rem 1.4rem 1.25rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  color: #f2f3f5;
}

.version-live__title {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.version-live__body {
  margin: 0 0 0.35rem;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.5;
  font-size: 0.95rem;
}

.version-live__builds {
  margin: 0 0 1.1rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
  font-variant-numeric: tabular-nums;
}

.version-live__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

.version-live__btn {
  min-height: 40px;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.version-live__btn--later {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: #ddd;
}

.version-live__btn--later:hover {
  background: rgba(255, 255, 255, 0.06);
}

.version-live__btn--reload {
  background: #5865f2;
  color: #fff;
}

.version-live__btn--reload:hover {
  filter: brightness(1.08);
}

/* Floating what’s-new panel */
.version-whatsnew {
  position: fixed;
  z-index: 205;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.version-whatsnew.is-placed {
  opacity: 1;
}

.version-whatsnew__card {
  pointer-events: auto;
  width: 300px;
  max-height: min(62vh, 480px);
  overflow: auto;
  background: linear-gradient(165deg, #1e2128 0%, #14161b 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 0.95rem 1rem 1rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  color: #f2f3f5;
  position: relative;
}

.version-whatsnew.points-left .version-whatsnew__card::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  border: 10px solid transparent;
  border-right-color: rgba(255, 255, 255, 0.14);
}

.version-whatsnew.points-left .version-whatsnew__card::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 9px solid transparent;
  border-right-color: #1a1d23;
}

.version-whatsnew__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}

.version-whatsnew__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.version-whatsnew__brand {
  margin: 0 1.5rem 0.25rem 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.version-whatsnew__meta {
  margin: 0 1.5rem 0.55rem 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}

.version-whatsnew__step {
  float: right;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
}

.version-whatsnew__title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  clear: both;
}

.version-whatsnew__body {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
}

.version-whatsnew__tip {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(88, 101, 242, 0.12);
  border: 1px solid rgba(88, 101, 242, 0.28);
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.8);
}

.version-whatsnew__actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.version-whatsnew__btn {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #eee;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.88rem;
}

.version-whatsnew__btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.version-whatsnew__btn--primary {
  background: #5865f2;
  border-color: transparent;
  color: #fff;
}

.version-whatsnew__btn--primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.version-whatsnew__btn:disabled,
.version-whatsnew__btn[aria-disabled='true'] {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

.version-whatsnew.is-compact {
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  bottom: 0 !important;
  transform: none !important;
  width: 100%;
}

.version-whatsnew.is-compact .version-whatsnew__card {
  width: 100%;
  max-width: none;
  border-radius: 16px 16px 0 0;
  max-height: min(52vh, 420px);
}

.version-whatsnew.is-compact .version-whatsnew__card::before,
.version-whatsnew.is-compact .version-whatsnew__card::after {
  display: none;
}

.version-whatsnew.is-compact .version-whatsnew__actions {
  flex-direction: row;
  flex-wrap: wrap;
}

.version-whatsnew.is-compact .version-whatsnew__btn {
  flex: 1 1 auto;
  min-height: 44px;
}

/* Anchor flash */
@keyframes skAnchorFlash {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(232, 197, 71, 0);
  }
  20%,
  50%,
  80% {
    box-shadow: 0 0 0 4px rgba(232, 197, 71, 0.55), 0 0 22px rgba(232, 197, 71, 0.35);
  }
}

.anchor-flash {
  animation: skAnchorFlash 2.2s ease;
  outline: 2px solid rgba(232, 197, 71, 0.7);
  outline-offset: 2px;
  border-radius: 6px;
}

.anchor-flash.anchor-flash--static {
  animation: none;
  box-shadow: 0 0 0 3px rgba(232, 197, 71, 0.65);
}

[id] {
  scroll-margin-top: 88px;
}

@media (prefers-reduced-motion: reduce) {
  .version-live,
  .version-whatsnew {
    transition: none;
  }

  .anchor-flash {
    animation: none;
    box-shadow: 0 0 0 3px rgba(232, 197, 71, 0.65);
  }
}
