/* Endless feed + real action states for the isolated preview. */
.real-feed-poll button::before {
  width: var(--poll, 0%) !important;
}

.real-feed-post button:disabled {
  cursor: wait;
  opacity: .58;
}

.real-feed-loader {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #8d897f;
  font-size: 10px;
}

.real-feed-loader[hidden] {
  display: none;
}

.real-feed-loader span {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(48,48,46,.16);
  border-top-color: #d6a52c;
  border-radius: 50%;
  opacity: 0;
}

.real-feed-loader b {
  font-weight: 500;
  opacity: 0;
}

.real-feed-loader.is-loading span {
  opacity: 1;
  animation: real-feed-spin .7s linear infinite;
}

.real-feed-loader.is-loading b {
  opacity: 1;
}

@keyframes real-feed-spin {
  to { transform: rotate(360deg); }
}

.real-feed-menu {
  position: fixed;
  z-index: 9999;
  width: 180px;
  overflow: hidden;
  padding: 6px;
  border: 1px solid rgba(214,208,188,.72);
  border-radius: 15px;
  background: rgba(255,253,247,.98);
  box-shadow: 0 18px 50px rgba(45,42,32,.14);
  backdrop-filter: blur(18px);
}

.real-feed-menu button {
  width: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4f4d47;
  font: inherit;
  font-size: 10px;
  text-align: left;
  cursor: pointer;
}

.real-feed-menu button:hover {
  background: #f3f0e5;
}

.real-feed-menu button.danger {
  color: #a9473e;
}

.profile-real-post {
  position: relative;
}

.profile-real-post > .real-feed-menu--anchored {
  position: absolute;
}

/* The global feed composer creates normal posts and polls only. LFG and Moments
   already have dedicated creation flows and do not belong in this modal. */
#postComposerModal [data-composer-type="LFG"],
#postComposerModal [data-composer-type="Moment"] {
  display: none !important;
}

/* Long post text stays inside its own scroll area while editing. This prevents
   the modal from growing past the viewport and always allows reaching line 1. */
.post-composer-modal.is-editing .composer-textarea-shell {
  min-height: 180px;
  max-height: min(290px, 32vh);
  overflow: hidden;
}

.post-composer-modal.is-editing #postComposerInput {
  height: min(270px, 30vh) !important;
  min-height: 180px !important;
  max-height: min(270px, 30vh) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  resize: none;
  scrollbar-gutter: stable;
}

.post-composer-modal.is-editing .post-composer-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Feeling picker reused by the global feed composer and profile composer. */
#composerLfgButton.is-active {
  background: #2f302d;
  color: #fffdf7;
}

#composerLfgButton > span {
  font-size: 18px;
  line-height: 1;
}

.composer-feeling-current {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 0 14px 0 16px;
  border: 1px solid rgba(182,78,68,.18);
  border-radius: 14px;
  background: rgba(244,226,221,.7);
  color: #4f4d47;
  font-size: 11px;
}

.composer-feeling-current[hidden] {
  display: none !important;
}

.composer-feeling-current button,
.composer-feeling-picker header button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255,253,247,.9);
  color: #6f6b62;
  font: inherit;
  font-size: 18px;
  cursor: pointer;
}

.composer-feeling-picker {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(214,208,188,.8);
  border-radius: 18px;
  background: #fffdf7;
  box-shadow: 0 18px 48px rgba(45,42,32,.12);
}

.composer-feeling-picker[hidden] {
  display: none !important;
}

.composer-feeling-picker header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #2f302d;
}

.composer-feeling-picker header strong {
  font-size: 12px;
  font-weight: 600;
}

.composer-feeling-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.composer-feeling-options button {
  min-width: 0;
  min-height: 64px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid rgba(214,208,188,.72);
  border-radius: 13px;
  background: #f4f1e9;
  color: #5d5a53;
  font: inherit;
  cursor: pointer;
}

.composer-feeling-options button:hover,
.composer-feeling-options button.is-active {
  border-color: rgba(182,78,68,.4);
  background: #f2e2de;
  color: #9e4038;
}

.composer-feeling-options button span {
  font-size: 22px;
  line-height: 1;
}

.composer-feeling-options button b {
  overflow: hidden;
  max-width: 100%;
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Profile and feed viewers must open images in fit mode. Some profile image
   rules use forced full-size dimensions, so the viewer has to win explicitly. */
.real-media-viewer__media > img {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  inline-size: auto !important;
  block-size: auto !important;
  max-inline-size: 100% !important;
  max-block-size: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  align-self: center;
  justify-self: center;
}

@media (max-width: 899px) {
  .real-feed-menu {
    width: min(200px, calc(100vw - 24px));
  }

  .post-composer-modal.is-editing .composer-textarea-shell {
    max-height: 34vh;
  }

  .post-composer-modal.is-editing #postComposerInput {
    height: 32vh !important;
    max-height: 32vh !important;
  }

  .composer-feeling-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
