/* Yapper v3.61 — compact Yap actions + inline reply drawer.
   Final-cascade file: intentionally overrides older action/composer rules. */

#yapFeed .post-author-information {
  flex: 1 1 auto;
  min-width: 0;
}

#yapFeed .delete-yap-top {
  flex: 0 0 auto;
  align-self: flex-start;
  width: auto !important;
  min-width: 0 !important;
  height: 30px !important;
  min-height: 30px !important;
  margin: 1px 0 0 auto !important;
  padding: 0 10px !important;
  border-radius: 9999px !important;
  border: 1px solid color-mix(in srgb, var(--border) 86%, transparent) !important;
  background: color-mix(in srgb, var(--input) 78%, transparent) !important;
  color: var(--secondary-text) !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  line-height: 1 !important;
  white-space: nowrap;
  box-shadow: none !important;
}

#yapFeed .delete-yap-top:is(:hover, :active, :focus-visible) {
  color: var(--text) !important;
  border-color: color-mix(in srgb, var(--primary) 52%, var(--border)) !important;
  background: color-mix(in srgb, var(--primary) 9%, var(--input)) !important;
}

/* Like / Reply / Share are one equal three-part rail on ordinary Yaps. */
#yapFeed .post-actions:not(.question-snippet-actions) {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  gap: 9px !important;
  width: 100% !important;
  margin-top: 13px !important;
}

#yapFeed .post-actions:not(.question-snippet-actions) > button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 10px !important;
  white-space: nowrap !important;
}

#yapFeed .post-actions .action-count {
  display: inline-block;
  min-width: 0;
  overflow: visible;
  color: inherit;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

#yapFeed .reply-yap-button {
  color: var(--text);
}

#yapFeed .reply-yap-button.active {
  background: var(--primary) !important;
  color: var(--primary-text) !important;
  border-color: var(--primary) !important;
}

#yapFeed .reply-action-icon,
#yapFeed .share-yap-button svg {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 18px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* Reply button opens one compact drawer: composer stays fixed on top while
   replies scroll underneath. */
#yapFeed .yap-replies-panel {
  display: grid;
  grid-template-rows: auto minmax(0, auto);
  gap: 10px;
  width: 100%;
  margin-top: 10px;
  padding-top: 1px;
  transform-origin: top center;
}

#yapFeed .yap-replies-panel.is-opening {
  animation: yapRepliesPanelOpen 220ms cubic-bezier(.2,.82,.2,1) both;
}

#yapFeed .yap-replies-panel.is-closing {
  pointer-events: none;
  animation: yapRepliesPanelClose 220ms cubic-bezier(.4,0,.2,1) both;
}

@keyframes yapRepliesPanelOpen {
  from { opacity: 0; transform: translateY(-7px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes yapRepliesPanelClose {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-6px) scale(.985); }
}

#yapFeed .yap-replies-composer-header {
  position: relative;
  z-index: 2;
  width: 100%;
}

#yapFeed .yap-replies-panel .yap-reply-composer {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 44px !important;
  align-items: end !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 !important;
}

#yapFeed .yap-replies-panel .yap-reply-composer textarea {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 44px !important;
  max-height: 68px !important;
  margin: 0 !important;
  padding: 10px 15px !important;
  resize: none !important;
  overflow-y: hidden;
  background: var(--input) !important;
  color: var(--text) !important;
  caret-color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 9999px !important;
  outline: none !important;
  font: inherit;
  font-size: 15px !important;
  line-height: 22px !important;
}

#yapFeed .yap-replies-panel .yap-reply-composer textarea.bubble-multiline {
  border-radius: 23px !important;
}

#yapFeed .yap-replies-panel .send-reply-button {
  display: inline-grid !important;
  place-items: center !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: var(--primary) !important;
  color: var(--primary-text) !important;
  border-color: var(--primary) !important;
}

#yapFeed .yap-replies-panel .send-reply-button:disabled {
  opacity: .65;
}

#yapFeed .send-reply-arrow {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#yapFeed .yap-replies-scroll {
  width: 100%;
  max-height: 276px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding: 1px 5px 3px 0;
  scroll-behavior: auto;
}

#yapFeed .yap-replies-scroll::-webkit-scrollbar {
  width: 5px;
}

#yapFeed .yap-replies-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--secondary-text) 45%, transparent);
  border-radius: 999px;
}

#yapFeed .yap-replies-scroll .replies-list {
  margin-top: 0 !important;
  gap: 13px !important;
}

#yapFeed .yap-replies-empty,
#yapFeed .yap-replies-loading {
  margin: 4px 0 2px !important;
  padding: 13px 12px !important;
  color: var(--secondary-text) !important;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
}

/* The old bottom Replies/Delete strip is intentionally gone. The card and
   feed gap tighten together so the new shorter Yaps do not look detached. */
#yapFeed > .yap,
#yapFeed .feed-entry > .yap {
  padding-bottom: 16px !important;
  margin-top: 12px !important;
}

@media (max-width: 760px) {
  #yapFeed {
    gap: 10px !important;
  }

  #yapFeed > .yap,
  #yapFeed .feed-entry > .yap {
    margin-top: 0 !important;
    padding-bottom: 13px !important;
  }

  #yapFeed .post-actions:not(.question-snippet-actions) {
    gap: 7px !important;
  }

  #yapFeed .post-actions:not(.question-snippet-actions) > button {
    height: 45px !important;
    min-height: 45px !important;
    padding-inline: 7px !important;
  }

  #yapFeed .yap-replies-panel .yap-reply-composer {
    grid-template-columns: minmax(0, 1fr) 45px !important;
  }

  #yapFeed .yap-replies-panel .yap-reply-composer textarea {
    min-height: 45px !important;
  }

  #yapFeed .yap-replies-panel .send-reply-button {
    width: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    height: 45px !important;
    min-height: 45px !important;
  }

  #yapFeed .yap-replies-scroll {
    max-height: 252px;
    padding-right: 3px;
  }

  #yapFeed .delete-yap-top {
    height: 29px !important;
    min-height: 29px !important;
    padding-inline: 9px !important;
    font-size: 10.5px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #yapFeed .yap-replies-panel.is-opening,
  #yapFeed .yap-replies-panel.is-closing {
    animation: none !important;
  }
}
