.cks-ephemeral-test-render {
  width: 100%;
}

.cks-ephemeral-rail {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 2px 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scroll-snap-type: x proximity;
}

.cks-ephemeral-avatar {
  flex: 0 0 72px;
  width: 72px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: center;
  color: inherit
}

.cks-ephemeral-ring {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  box-sizing: border-box;
  padding: 3px;
  background: #a7a7a7;
  overflow: hidden;
  margin: 0 auto 6px
}

/* Halo transition: the gradient fades independently from the gray base. */
.cks-ephemeral-ring {
  position: relative;
  isolation: isolate;
  background: #a7a7a7;
  transition: background-color .4s ease
}

.cks-ephemeral-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
  opacity: 0;
  transition: opacity .42s ease;
  pointer-events: none;
  z-index: 0
}

.cks-ephemeral-ring--new {
  background: transparent
}

.cks-ephemeral-ring--new::before {
  opacity: 1
}

.cks-ephemeral-ring>span {
  position: relative;
  z-index: 1
}

@media(prefers-reduced-motion:reduce) {

  .cks-ephemeral-ring,
  .cks-ephemeral-ring::before {
    transition: none
  }
}

.cks-ephemeral-ring>span {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  padding: 2px
}

.cks-ephemeral-ring img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: #a7a7a7;
  object-fit: cover
}

.cks-ephemeral-initial {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #eee;
  font-weight: 600
}

.cks-ephemeral-name {
  display: block;
  min-height: 1.2em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px
}

.cks-ephemeral-publish-trigger {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #d62976;
  color: #fff;
  cursor: pointer;
  transition: transform .15s, opacity .15s
}

.cks-ephemeral-publish-trigger:hover {
  transform: scale(1.05)
}

.cks-ephemeral-publish-trigger svg {
  width: 24px;
  height: 24px
}

.cks-ephemeral-file-input {
  display: none !important
}

.cks-ephemeral-compose {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(12, 12, 12, .82);
  align-items: center;
  justify-content: center;
  padding: 16px
}

.cks-ephemeral-compose.is-open {
  display: flex
}

.cks-ephemeral-compose__panel {
  position: relative;
  width: min(100%, 390px);
  padding: 18px;
  border-radius: 18px;
  background: #fff;
  color: #222;
  box-shadow: 0 15px 60px #0005
}

.cks-ephemeral-compose__close {
  position: absolute;
  right: 6px;
  top: 6px;
  border: 0;
  background: var(--white);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  border-radius: 9px;
}

.cks-ephemeral-compose__close svg {
  width: 32px;
  height: 32px;
}

.cks-ephemeral-compose__preview {
  display: grid;
  place-items: center;
  min-height: 180px;
  max-height: 65vh;
  overflow: hidden;
  background: #111;
  border-radius: 12px
}

.cks-ephemeral-compose__preview img,
.cks-ephemeral-compose__preview video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain
}

.cks-ephemeral-compose__caption {
  font-size: 13px;
  color: #666;
  text-align: center;
  margin: 12px 0
}

.cks-ephemeral-compose__submit {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: #F02D82;
  color: #fff;
  font-weight: 600;
  cursor: pointer
}

.cks-ephemeral-compose__submit:disabled {
  opacity: .6;
  cursor: wait
}

.cks-ephemeral-toast {
  position: fixed;
  z-index: 1000002;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 15px);
  opacity: 0;
  pointer-events: none;
  max-width: min(92vw, 440px);
  padding: 12px 18px;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 5px 25px #0003;
  transition: opacity .2s, transform .2s
}

.cks-ephemeral-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0)
}

.cks-ephemeral-toast.is-error {
  background: var(--wp--preset--color--luminous-vivid-amber);
  color: var(--black);
}

.cks-ephemeral-toast.is-success {
  background: #F02D82;
}

.cks-ephemeral-viewer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, .96);
  align-items: center;
  justify-content: center
}

.cks-ephemeral-viewer.is-open {
  display: flex
}

.cks-ephemeral-viewer__inner {
  position: relative;
  width: min(100vw, 480px);
  height: min(100dvh, 850px);
  background: #111;
  overflow: hidden;
  border-radius: 10px
}

.cks-ephemeral-media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center
}

.cks-ephemeral-media img,
.cks-ephemeral-media video {
  width: 100%;
  height: 100%;
  object-fit: contain
}

.cks-ephemeral-viewer__header {
  position: absolute;
  z-index: 4;
  left: 12px;
  right: 12px;
  top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff
}

.cks-ephemeral-close {
  color: #fff;
  background: transparent;
  border: 0;
  font-size: 32px;
  cursor: pointer
}

.cks-ephemeral-progress {
  position: absolute;
  z-index: 5;
  top: 10px;
  left: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  height: 3px
}

.cks-ephemeral-progress__segment {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(255, 255, 255, .38)
}

.cks-ephemeral-progress__segment i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff
}

.cks-ephemeral-progress__segment.is-complete i {
  width: 100%
}

.cks-ephemeral-progress__segment i.is-current {
  animation: cks-ephemeral-progress linear forwards
}

.cks-ephemeral-prev,
.cks-ephemeral-next {
  position: absolute;
  z-index: 3;
  top: 16%;
  bottom: 0;
  width: 38%;
  border: 0;
  background: transparent
}

.cks-ephemeral-prev {
  left: 0
}

.cks-ephemeral-next {
  right: 0
}

@keyframes cks-ephemeral-progress {
  to {
    width: 100%
  }
}

.cks-ephemeral-inline-note {
  font-size: 13px;
  color: #777
}

/* 0.2.1 — visor enriquecido y preview de publicación */
.cks-ephemeral-viewer__header {
  top: 26px;
  left: 14px;
  right: 14px;
  gap: 12px;
  align-items: center
}

.cks-ephemeral-viewer__identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 4px #0008
}

.cks-ephemeral-viewer__avatar {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .9);
  object-fit: cover;
  background: #333
}

.cks-ephemeral-viewer__profile {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.cks-ephemeral-viewer__controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto
}

.cks-ephemeral-audio {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .25);
  color: #fff;
  cursor: pointer
}

.cks-ephemeral-audio svg {
  width: 22px;
  height: 22px
}

.cks-ephemeral-audio__on {
  display: none
}

.cks-ephemeral-audio.is-audio-on .cks-ephemeral-audio__off {
  display: none
}

.cks-ephemeral-audio.is-audio-on .cks-ephemeral-audio__on {
  display: block
}

.cks-ephemeral-close {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 30px;
  line-height: 1;
  text-shadow: 0 1px 5px #0008;
}

.cks-ephemeral-whatsapp {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(20, 20, 20, .3);
  color: #fff;
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition: background .18s, transform .18s
}

.cks-ephemeral-whatsapp:hover {
  background: rgba(214, 41, 118, .78);
  color: #fff;
  transform: translateX(-50%) scale(1.05)
}

.cks-ephemeral-whatsapp svg {
  width: 25px;
  height: 25px
}

.cks-ephemeral-whatsapp[hidden],
.cks-ephemeral-viewer__avatar[hidden] {
  display: none !important
}

.cks-ephemeral-prev,
.cks-ephemeral-next {
  top: 18%;
  bottom: 88px;
  width: 38%;
  z-index: 2
}

.cks-ephemeral-prev {
  left: 0
}

.cks-ephemeral-next {
  right: 0
}

.cks-ephemeral-viewer__header {
  z-index: 7
}

.cks-ephemeral-progress {
  z-index: 8
}

.cks-ephemeral-media {
  z-index: 1
}

.cks-ephemeral-compose__panel {
  width: min(94vw, 520px);
  padding: 20px
}

.cks-ephemeral-compose__preview {
  min-height: 220px;
  height: min(70vh, 680px);
  max-height: 70vh
}


@media(max-width:520px) {
  .cks-ephemeral-viewer__inner {
    width: 100vw;
    height: 100dvh;
    border-radius: 0
  }

  .cks-ephemeral-compose__panel {
    padding: 14px
  }

  .cks-ephemeral-compose__preview {
    height: min(68vh, 620px)
  }

  .cks-ephemeral-whatsapp {
    bottom: 24px
  }
}

/* 0.2.2: indicador de carga, estado visto y enlace de perfil */
.cks-ephemeral-compose__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .18s, opacity .18s
}

.cks-ephemeral-compose__submit.is-loading {
  background: #9f1f59;
  opacity: 1
}

.cks-ephemeral-compose__spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cks-ephemeral-spin .7s linear infinite;
  flex: 0 0 17px
}

.cks-ephemeral-compose__spinner[hidden] {
  display: none !important
}

@keyframes cks-ephemeral-spin {
  to {
    transform: rotate(360deg)
  }
}

.cks-ephemeral-ring--seen {
  background: #a7a7a7 !important
}

.cks-ephemeral-viewer__profile-link {
  display: block;
  color: inherit;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer
}

.cks-ephemeral-viewer__profile-link:hover {
  color: #fff;
  text-decoration: none;
  text-underline-offset: 3px;
}

/* 0.2.4: links de perfil en la misma pestaña y hora de publicación */
.cks-ephemeral-viewer__identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0
}

.cks-ephemeral-viewer__avatar-link {
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  line-height: 0
}

.cks-ephemeral-viewer__avatar-link[hidden] {
  display: none !important
}

.cks-ephemeral-viewer__identity-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0
}

.cks-ephemeral-viewer__published {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, .78);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 400
}

.cks-ephemeral-ring--seen {
  background: #a7a7a7 !important
}

/* Initial hydration guard: avoid showing the server's default "new" ring
   before JS has reconciled seen IDs from browser storage. */
html:not(.cks-ephemeral-rings-ready) .cks-ephemeral-ring--new {
  background: #a7a7a7 !important
}

html:not(.cks-ephemeral-rings-ready) .cks-ephemeral-ring::before {
  opacity: 0 !important;
  transition: none !important
}

/* Initial state: neutral gray until JS has matched local viewed-story IDs. */
html:not(.cks-ephemeral-rings-ready) .cks-ephemeral-ring,
html:not(.cks-ephemeral-rings-ready) .cks-ephemeral-ring--new {
  background: #a7a7a7 !important;
  background-color: #a7a7a7 !important;
}

html:not(.cks-ephemeral-rings-ready) .cks-ephemeral-ring--new::before {
  opacity: 0 !important;
}

.cks-ephemeral-rail::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0
}

/* 0.2.12: preserve the classic white separator inside the halo.
   The outer ring remains gray/gradient; the avatar stays inset by 2px. */
.cks-ephemeral-avatar__image-frame {
  background: #fff !important;
  border-radius: 50%;
  overflow: hidden;
}