/**
 * Stories tray + composer + viewer. Scoped to .cotinder-stories / .cotinder-stories-ui.
 * Does not touch custom.css / footer.php.
 */

.cotinder-index-feed > .cotinder-stories,
.cotinder-index-feed > .cotinder-stories-shelf {
  grid-column: 1 / -1;
  order: -20;
}

.cotinder-stories-shelf {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.cotinder-stories-shelf > .cotinder-stories {
  flex: 0 1 auto;
  width: max-content;
  max-width: calc(100% - 96px);
  min-width: 0;
  margin: 0;
}

.cotinder-stories {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 12px;
  padding: 8px 10px 12px 4px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cotinder-stories::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.cotinder-stories[hidden] {
  display: none !important;
}

.cotinder-stories-shelf[hidden] {
  display: none !important;
}

html body .cotinder-stories a.cotinder-stories__ring.is-guest {
  display: none !important;
}

html body .cotinder-stories button.cotinder-stories__ring,
html body .cotinder-stories-shelf > button.cotinder-stories__ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  width: 84px;
  max-width: 84px;
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: inherit;
  scroll-snap-align: start;
}

html body .cotinder-stories-shelf > button.js-cotinder-stories-compose-fallback {
  display: none !important;
  margin: 8px 10px 12px 0;
}

html body[data-user-authorized="1"] .cotinder-stories-shelf > button.js-cotinder-stories-compose-fallback:not([hidden]) {
  display: flex !important;
}

html body .cotinder-stories .cotinder-stories__avatar-wrap,
html body .cotinder-stories-shelf .cotinder-stories__avatar-wrap {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  min-width: 72px;
  min-height: 72px;
  max-width: 72px;
  max-height: 72px;
  margin: 0 auto 6px;
  padding: 0;
  border-radius: 50%;
  box-sizing: border-box;
  background: #fd7728;
  overflow: hidden;
}

.cotinder-stories__ring.is-unseen .cotinder-stories__avatar-wrap {
  background: #fd7728;
}

.cotinder-stories__ring.is-own .cotinder-stories__avatar-wrap {
  background: #fd7728;
}

.cotinder-stories__ring.is-has:not(.is-unseen) .cotinder-stories__avatar-wrap {
  background: #d8d8d8;
}

html body .cotinder-stories .cotinder-stories__photo,
html body .cotinder-stories img.cotinder-stories__avatar,
html body .cotinder-stories .cotinder-stories__avatar-wrap > img {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 66px !important;
  height: 66px !important;
  min-width: 66px !important;
  min-height: 66px !important;
  max-width: 66px !important;
  max-height: 66px !important;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  box-sizing: border-box;
  background-color: #fff5ee;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  object-fit: cover !important;
  object-position: center center;
  aspect-ratio: 1 / 1;
  display: block;
  flex: none;
}

html body .cotinder-stories .cotinder-stories__photo--empty {
  background-image: none;
}

.cotinder-stories__add {
  position: absolute;
  right: -1px;
  bottom: -1px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #fd7728;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: auto;
}

.cotinder-stories__plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff5ee;
  color: #fd7728;
  font-size: 28px;
  line-height: 1;
}

.cotinder-stories__name {
  display: block;
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
  color: #3d3d3d;
}

body.cotinder-stories-open {
  overflow: hidden;
}

.cotinder-stories-ui {
  position: fixed;
  inset: 0;
  z-index: 13080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.cotinder-stories-ui[hidden] {
  display: none !important;
}

.cotinder-stories-ui__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(45, 45, 45, 0.55);
}

.cotinder-stories-ui__panel {
  position: relative;
  z-index: 1;
  width: min(420px, calc(100% - 8px));
  max-height: min(92vh, 720px);
  overflow: auto;
  padding: 24px 20px 18px;
  border-radius: 16px;
  background: #fff;
  box-sizing: border-box;
}

.cotinder-stories-ui__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(45, 45, 45, 0.08);
  color: #5a5a5a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.cotinder-stories-ui__title {
  margin: 0 32px 8px 0;
  font-size: 20px;
  font-weight: 700;
  color: #2d2d2d;
}

.cotinder-stories-ui__lead {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
  color: #6b6b6b;
}

.cotinder-stories-ui__field {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #3d3d3d;
}

html body .cotinder-stories-ui .cotinder-stories-ui__field[hidden],
html body .cotinder-stories-ui .js-cotinder-stories-preview-img[hidden],
html body .cotinder-stories-ui .js-cotinder-stories-preview-video[hidden] {
  display: none !important;
}

.cotinder-stories-ui__field em {
  font-style: normal;
  font-weight: 500;
  color: #8a8a8a;
}

.cotinder-stories-ui__field input[type="text"],
.cotinder-stories-ui__field input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 6px;
  box-sizing: border-box;
  font: inherit;
  font-weight: 400;
}

.cotinder-stories-ui__field input[type="text"] {
  padding: 10px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
}

.cotinder-stories-ui__pets {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(220px, 36vh);
  margin-top: 8px;
  padding: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid #ebe3dc;
  border-radius: 14px;
  background: #fffaf6;
  touch-action: pan-y;
}

.cotinder-stories-ui__pet {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: #2d2d2d;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.cotinder-stories-ui__pet.is-on {
  border-color: #fd7728;
  background: #fff3ea;
  box-shadow: inset 0 0 0 1px rgba(253, 119, 40, 0.25);
}

.cotinder-stories-ui__pet-ava {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0e6de center / cover no-repeat;
}

.cotinder-stories-ui__pet-ava.is-empty {
  background-image: none;
  background-color: #f3ebe4;
}

.cotinder-stories-ui__pet-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cotinder-stories-ui__form[hidden],
.cotinder-stories-ui__success[hidden] {
  display: none !important;
}

.cotinder-stories-ui__success {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 4px;
}

.cotinder-stories-ui__success-card {
  position: relative;
  width: 100%;
  padding: 28px 18px 20px;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(253, 119, 40, 0.22), transparent 55%),
    linear-gradient(180deg, #fff8f2 0%, #ffffff 55%);
  text-align: center;
  overflow: hidden;
}

.cotinder-stories-ui__success-glow {
  position: absolute;
  inset: auto -20% -40% -20%;
  height: 55%;
  background: radial-gradient(circle at 50% 0%, rgba(253, 119, 40, 0.18), transparent 70%);
  pointer-events: none;
}

.cotinder-stories-ui__success-kicker {
  position: relative;
  margin: 0 0 8px;
  color: #fd7728;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cotinder-stories-ui__success-title {
  position: relative;
  margin: 0 0 10px;
  color: #2d2d2d;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.cotinder-stories-ui__success-lead {
  position: relative;
  margin: 0 auto 18px;
  max-width: 28em;
  color: #6b6b6b;
  font-size: 15px;
  line-height: 1.45;
}

.cotinder-stories-ui__success-preview {
  position: relative;
  width: 120px;
  height: 214px;
  margin: 0 auto 18px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(45, 30, 20, 0.18);
  background: #f4f4f4;
}

.cotinder-stories-ui__success-preview img,
.cotinder-stories-ui__success-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cotinder-stories-ui__preview-wrap {
  margin: 0 0 12px;
}

.cotinder-stories-ui__preview {
  width: 180px;
  height: 320px;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #f4f4f4;
  position: relative;
}

.cotinder-stories-ui__preview img,
.cotinder-stories-ui__preview video {
  position: relative;
  z-index: 0;
}

.cotinder-stories-ui__preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cotinder-stories-ui__templates {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.cotinder-stories-ui__templates legend {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.cotinder-stories-ui__template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cotinder-stories-ui__tpl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.cotinder-stories-ui__tpl[data-tpl]::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 4px;
  box-sizing: border-box;
  background: var(--story-frame, #e8e8e8);
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--story-frame, #cfcfcf);
}

.cotinder-stories-ui__tpl.is-on {
  border-color: #fd7728;
  color: #fd7728;
  font-weight: 700;
}

.cotinder-stories-ui__error {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff0f0;
  color: #b42318;
  font-size: 14px;
}

.cotinder-stories-ui__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  border: 1px solid #fd7728;
  border-radius: 12px;
  background: #fd7728;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.cotinder-stories-ui__submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.cotinder-stories-frame {
  --story-frame: transparent;
}

.cotinder-stories-frame::after {
  content: none;
}

.cotinder-stories-frame__ring {
  position: absolute;
  inset: 0;
  z-index: 8;
  box-sizing: border-box;
  border: 8px solid transparent;
  border-radius: inherit;
  pointer-events: none;
}

.cotinder-stories-frame__ring[hidden] {
  display: none !important;
}

.cotinder-stories-frame--plain,
.cotinder-stories-ui__tpl[data-tpl="plain"] { --story-frame: #e0e0e0; }
.cotinder-stories-frame--sunset,
.cotinder-stories-ui__tpl[data-tpl="sunset"] { --story-frame: #fd7728; }
.cotinder-stories-frame--paw,
.cotinder-stories-ui__tpl[data-tpl="paw"] { --story-frame: #41a3d0; }
.cotinder-stories-frame--sky,
.cotinder-stories-ui__tpl[data-tpl="sky"] { --story-frame: #7eb8d8; }
.cotinder-stories-frame--berry,
.cotinder-stories-ui__tpl[data-tpl="berry"] { --story-frame: #d57db0; }
.cotinder-stories-frame--hello,
.cotinder-stories-ui__tpl[data-tpl="hello"] { --story-frame: #f4c36a; }
.cotinder-stories-frame--morning,
.cotinder-stories-ui__tpl[data-tpl="morning"] { --story-frame: #f0a05a; }
.cotinder-stories-frame--stroll,
.cotinder-stories-ui__tpl[data-tpl="stroll"] { --story-frame: #6bbf8a; }
.cotinder-stories-frame--meal,
.cotinder-stories-ui__tpl[data-tpl="meal"] { --story-frame: #e09a5a; }
.cotinder-stories-frame--nap,
.cotinder-stories-ui__tpl[data-tpl="nap"] { --story-frame: #8aa0c8; }
.cotinder-stories-frame--party,
.cotinder-stories-ui__tpl[data-tpl="party"] { --story-frame: #e56bb0; }
.cotinder-stories-frame--bath,
.cotinder-stories-ui__tpl[data-tpl="bath"] { --story-frame: #6ec4e0; }
.cotinder-stories-frame--hug,
.cotinder-stories-ui__tpl[data-tpl="hug"] { --story-frame: #f08a9a; }
.cotinder-stories-frame--park,
.cotinder-stories-ui__tpl[data-tpl="park"] { --story-frame: #7cb86a; }
.cotinder-stories-frame--rain,
.cotinder-stories-ui__tpl[data-tpl="rain"] { --story-frame: #6a8cb8; }
.cotinder-stories-frame--treat,
.cotinder-stories-ui__tpl[data-tpl="treat"] { --story-frame: #d4a04a; }
.cotinder-stories-frame--snow,
.cotinder-stories-ui__tpl[data-tpl="snow"] { --story-frame: #cfe6f2; }
.cotinder-stories-frame--dacha,
.cotinder-stories-ui__tpl[data-tpl="dacha"] { --story-frame: #8fbc6a; }
.cotinder-stories-frame--nye,
.cotinder-stories-ui__tpl[data-tpl="nye"] { --story-frame: #c9a227; }
.cotinder-stories-frame--bloom,
.cotinder-stories-ui__tpl[data-tpl="bloom"] { --story-frame: #e7a0c0; }
.cotinder-stories-frame--heat,
.cotinder-stories-ui__tpl[data-tpl="heat"] { --story-frame: #f0c04a; }
.cotinder-stories-frame--leaf,
.cotinder-stories-ui__tpl[data-tpl="leaf"] { --story-frame: #c47a3a; }
.cotinder-stories-frame--cozy,
.cotinder-stories-ui__tpl[data-tpl="cozy"] { --story-frame: #c48a6a; }
.cotinder-stories-frame--giftbox,
.cotinder-stories-ui__tpl[data-tpl="giftbox"] { --story-frame: #d45a6a; }
.cotinder-stories-frame--lights,
.cotinder-stories-ui__tpl[data-tpl="lights"] { --story-frame: #f2d36a; }
.cotinder-stories-frame--spark,
.cotinder-stories-ui__tpl[data-tpl="spark"] { --story-frame: #d9b4ff; }

.cotinder-stories-frame--plain::after {
  box-shadow: none;
}

.cotinder-stories-ui--viewer {
  padding: 0;
  background: #111;
}

.cotinder-stories-ui--viewer .cotinder-stories-ui__backdrop {
  background: #111;
}

.cotinder-stories-viewer {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  height: min(92vh, 780px);
  margin: 0 auto;
}

.cotinder-stories-viewer__progress {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
}

.cotinder-stories-viewer__bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.cotinder-stories-viewer__bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}

.cotinder-stories-viewer__bar.is-done > span {
  width: 100%;
}

.cotinder-stories-viewer__bar.is-on > span {
  width: 100%;
  animation: cotinder-stories-bar 5s linear forwards;
}

@keyframes cotinder-stories-bar {
  from { width: 0; }
  to { width: 100%; }
}

.cotinder-stories-viewer__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 44px 10px 12px;
  color: #fff;
}

.cotinder-stories-viewer__author {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.cotinder-stories-viewer__author[href]:hover .cotinder-stories-viewer__name {
  text-decoration: underline;
}

.cotinder-stories-viewer__avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  background-color: #fff5ee;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.cotinder-stories-viewer__avatar.is-empty {
  background-image: none;
}

.cotinder-stories-viewer__name {
  font-size: 14px;
  font-weight: 700;
}

.cotinder-stories-ui--viewer .cotinder-stories-ui__close {
  top: 14px;
  right: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.cotinder-stories-viewer__stage {
  position: relative;
  height: calc(100% - 132px);
  margin: 0 10px;
  border-radius: 14px;
  overflow: hidden;
  background: #222;
}

.cotinder-stories-viewer__stage img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.cotinder-stories-viewer__stage img[hidden],
.cotinder-stories-viewer__stage video[hidden] {
  display: none !important;
}

.cotinder-stories-viewer__caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 7;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 15px;
}

.cotinder-stories-viewer__hit {
  position: absolute;
  top: 70px;
  bottom: 72px;
  width: 42%;
  border: 0;
  background: transparent;
  cursor: pointer;
  z-index: 3;
}

.cotinder-stories-viewer__hit--prev { left: 0; }
.cotinder-stories-viewer__hit--next { right: 0; }

@media (max-width: 767.98px) {
  html body .cotinder-stories button.cotinder-stories__ring,
  html body .cotinder-stories-shelf > button.cotinder-stories__ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 84px;
    max-width: 84px;
    height: auto;
  }

  html body .cotinder-stories .cotinder-stories__avatar-wrap,
  html body .cotinder-stories-shelf .cotinder-stories__avatar-wrap {
    width: 72px;
    height: 72px;
    min-width: 72px;
    min-height: 72px;
    max-width: 72px;
    max-height: 72px;
    flex-basis: 72px;
    overflow: hidden;
  }

  html body .cotinder-stories .cotinder-stories__photo {
    width: 66px;
    height: 66px;
    max-width: 66px;
    max-height: 66px;
  }

  .cotinder-stories-ui {
    align-items: flex-end;
    padding: max(8px, env(safe-area-inset-top, 0px)) 8px max(8px, env(safe-area-inset-bottom, 0px));
  }

  .cotinder-stories-ui__panel {
    width: 100%;
    max-height: min(92dvh, 720px);
    border-radius: 16px 16px 12px 12px;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .cotinder-stories-ui--viewer {
    align-items: stretch;
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  }

  .cotinder-stories-viewer {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
  }

  .cotinder-stories-ui__preview {
    width: min(180px, 46vw);
    height: min(320px, 48vh);
  }
}

@media (max-width: 1023.98px) and (display-mode: standalone),
       (max-width: 1023.98px) and (display-mode: fullscreen) {
  .cotinder-stories-ui {
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .cotinder-stories-ui__panel {
    max-height: min(92dvh, 720px);
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  .cotinder-stories-ui--viewer {
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

html.cotinder-pwa-standalone .cotinder-stories-ui,
body.cotinder-pwa-standalone .cotinder-stories-ui {
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

html.cotinder-pwa-standalone .cotinder-stories-ui__panel,
body.cotinder-pwa-standalone .cotinder-stories-ui__panel {
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

html.cotinder-pwa-standalone .cotinder-stories-ui--viewer,
body.cotinder-pwa-standalone .cotinder-stories-ui--viewer {
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.cotinder-stories-ui__tpl.is-locked {
  opacity: 0.7;
}

.cotinder-stories-ui__preview video,
.cotinder-stories-viewer__stage video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cotinder-stories-ui__stickers-on {
  position: absolute;
  inset: 10px;
  z-index: 2;
  pointer-events: none;
}

.cotinder-stories-ui__preview,
.cotinder-stories-viewer__stage {
  position: relative;
}

.cotinder-stories-sticker {
  position: absolute;
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.cotinder-stories-sticker--paw { top: 8%; left: 8%; }
.cotinder-stories-sticker--bowl { bottom: 18%; left: 10%; }
.cotinder-stories-sticker--walk { top: 12%; right: 10%; }
.cotinder-stories-sticker--heart { top: 40%; right: 12%; }
.cotinder-stories-sticker--fish { bottom: 22%; right: 12%; }
.cotinder-stories-sticker--bone { bottom: 12%; left: 40%; }
.cotinder-stories-sticker--sun { top: 6%; left: 42%; }
.cotinder-stories-sticker--moon { top: 8%; right: 40%; }
.cotinder-stories-sticker--champ { top: 6%; left: 8%; font-size: 32px; }

.cotinder-stories-viewer__reply {
  margin-left: auto;
  margin-right: 36px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: #fd7728;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.cotinder-stories-viewer__react {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 18px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.cotinder-stories-viewer__like,
.cotinder-stories-viewer__cmt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cotinder-stories-viewer__like.is-on {
  background: #fd7728;
}

.cotinder-stories-viewer__like:disabled {
  opacity: 0.7;
  cursor: default;
}

.cotinder-stories-viewer__like-icon {
  font-size: 16px;
  line-height: 1;
}

.cotinder-stories-viewer__login {
  margin-left: auto;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
}

.cotinder-stories-viewer__comments {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 62px;
  z-index: 13;
  max-height: min(42vh, 280px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(20, 16, 14, 0.88);
  color: #fff;
  backdrop-filter: blur(6px);
}

.cotinder-stories-viewer__comments-list {
  overflow: auto;
  max-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cotinder-stories-viewer__cmt {
  font-size: 13px;
  line-height: 1.35;
}

.cotinder-stories-viewer__cmt strong {
  font-weight: 700;
}

.cotinder-stories-viewer__cmt-empty {
  margin: 0;
  opacity: 0.8;
  font-size: 13px;
}

.cotinder-stories-viewer__cmt-form {
  display: flex;
  gap: 8px;
}

.cotinder-stories-viewer__cmt-form[hidden] {
  display: none !important;
}

.cotinder-stories-viewer__cmt-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  font: inherit;
  font-size: 14px;
}

.cotinder-stories-viewer__cmt-form button {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #fd7728;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.cotinder-stories-viewer__cmt-err {
  margin: 0;
  color: #ffc9b0;
  font-size: 12px;
}

.cotinder-stories-viewer__stage {
  height: calc(100% - 128px);
}

body.cotinder-stories-comments-open .cotinder-stories-viewer__hit {
  pointer-events: none;
}

@media (max-width: 767.98px) {
  .cotinder-stories-viewer__react {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .cotinder-stories-viewer__comments {
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }
}

.cotinder-stories-viewer__react {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 8px 12px 10px;
  position: relative;
  z-index: 6;
}

.cotinder-stories-viewer__like,
.cotinder-stories-viewer__cmt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.cotinder-stories-viewer__like.is-on {
  background: #fd7728;
}

.cotinder-stories-viewer__like:disabled {
  opacity: 0.55;
  cursor: default;
}

.cotinder-stories-viewer__login {
  margin-left: auto;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}

.cotinder-stories-viewer__comments {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 62px;
  z-index: 8;
  max-height: 42%;
  padding: 10px;
  border-radius: 12px;
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
}

.cotinder-stories-viewer__comments-list {
  max-height: 160px;
  overflow: auto;
}

.cotinder-stories-viewer__cmt {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.35;
}

.cotinder-stories-viewer__cmt strong {
  margin-right: 4px;
}

.cotinder-stories-viewer__cmt-empty,
.cotinder-stories-viewer__cmt-err {
  margin: 0 0 8px;
  font-size: 13px;
}

.cotinder-stories-viewer__cmt-err {
  color: #ffb4a2;
}

.cotinder-stories-viewer__cmt-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.cotinder-stories-viewer__cmt-form input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #222;
  font: inherit;
}

.cotinder-stories-viewer__cmt-form button {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: #fd7728;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}


.cotinder-stories-engage {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff5ee;
  color: #3d3d3d;
}
.cotinder-stories-engage p { margin: 0 0 8px; font-size: 14px; }
.cotinder-stories-engage__go {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  background: #fd7728;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.cotinder-engage .cotinder-stories-engage--hub {
  margin: 10px 0 14px;
}

.cotinder-stories-shop {
  margin: 16px 0 8px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fff8f2;
}
.cotinder-stories-shop__lead { margin: 0 0 10px; font-size: 14px; }
.cotinder-stories-shop__btn {
  border: 0;
  border-radius: 10px;
  padding: 8px 14px;
  background: #fd7728;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.cotinder-stories-shop__ok { margin: 8px 0 0; font-size: 14px; color: #2f7d32; }

/* Composer: a story card, not a raw form. */
html body .cotinder-stories-ui--composer .cotinder-stories-ui__panel {
  width: 440px;
  max-width: calc(100% - 8px);
  padding: 22px 18px 16px;
  border-radius: 28px;
  background-color: #fff7f1;
  background-image: linear-gradient(180deg, #fff7f1 0%, #ffffff 48%);
  box-shadow: 0 24px 60px rgba(70, 32, 8, 0.22);
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__kicker {
  margin: 0 36px 4px 0;
  color: #fd7728;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__title {
  margin: 0 36px 6px 0;
  font-size: 26px;
  line-height: 1.15;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__lead {
  margin: 0 0 14px;
  max-width: 34em;
  color: #6d625b;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__preview-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 16px;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__preview {
  width: min(220px, 62vw);
  height: min(360px, 48vh);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)),
    #f6ebe3;
  box-shadow: 0 16px 36px rgba(90, 42, 16, 0.16);
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__drop {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__drop-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: calc(100% - 28px);
  margin: 0 14px;
  padding: 18px 12px;
  border: 1.5px dashed rgba(253, 119, 40, 0.55);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  text-align: center;
  box-sizing: border-box;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__preview:has(img:not([hidden])) .cotinder-stories-ui__drop-face,
html body .cotinder-stories-ui--composer .cotinder-stories-ui__preview:has(video:not([hidden])) .cotinder-stories-ui__drop-face {
  opacity: 0;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__drop-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fd7728;
  color: #fff;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__drop-title {
  color: #2d2d2d;
  font-size: 16px;
  font-weight: 800;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__drop-note {
  color: #8a7b70;
  font-size: 13px;
  font-weight: 500;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__templates legend {
  margin: 0 0 8px;
  color: #8a7b70;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__templates legend em {
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__template-row {
  gap: 8px;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__tpl {
  min-height: 36px;
  padding: 7px 12px;
  border-color: rgba(253, 119, 40, 0.18);
  background: #fff;
  box-shadow: 0 1px 0 rgba(90, 42, 16, 0.04);
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__field input[type="text"] {
  min-height: 46px;
  border: 1px solid rgba(253, 119, 40, 0.22);
  border-radius: 14px;
  background: #fff;
}

html body .cotinder-stories-ui--composer .cotinder-stories-ui__submit {
  min-height: 52px;
  margin-top: 4px;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(253, 119, 40, 0.28);
}

@media (max-width: 767.98px) {
  html body .cotinder-stories-ui--composer {
    align-items: flex-end;
    padding: 0;
  }

  html body .cotinder-stories-ui--composer .cotinder-stories-ui__panel {
    width: 100%;
    max-width: 100%;
    max-height: min(94dvh, 820px);
    border-radius: 28px 28px 0 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    background-color: #fff7f1;
    background-image: linear-gradient(180deg, #fff7f1 0%, #ffffff 48%);
  }

  html body .cotinder-stories-ui--composer .cotinder-stories-ui__preview {
    width: min(200px, 58vw);
    height: min(320px, 42vh);
  }
}
