.li-reader-block--feedback-ready {
  position: relative;
  padding-bottom: 0;
}

.li-reader-block--feedback-ready::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 22px;
}

.li-reader-block--feedback-commenting {
  padding-bottom: 66px;
}

.li-reader-block--warm.li-reader-block--feedback-ready {
  padding-bottom: 28px;
}

.li-feedback-shell {
  position: absolute;
  top: calc(100% - 6px);
  right: 0;
  z-index: 4;
  margin-top: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.li-reader-block--feedback-ready:hover .li-feedback-shell,
.li-feedback-shell:hover,
.li-feedback-shell:focus-within,
.li-feedback-shell.is-commenting,
.li-feedback-shell.is-responded,
.li-feedback-shell.is-mobile-visible {
  opacity: 1;
  visibility: visible;
}

.li-reader-block--feedback-ready:hover .li-feedback-shell,
.li-feedback-shell:hover,
.li-feedback-shell:focus-within,
.li-feedback-shell.is-commenting,
.li-feedback-shell.is-mobile-visible {
  pointer-events: auto;
}

.li-feedback-shell.is-responded {
  opacity: 0.42;
  visibility: visible;
  pointer-events: auto;
}

.li-reader-block--feedback-ready:hover .li-feedback-shell.is-responded,
.li-feedback-shell.is-responded:hover,
.li-feedback-shell.is-responded:focus-within,
.li-feedback-shell.is-commenting {
  opacity: 0.94;
}

.li-feedback-controls {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-height: 38px;
}

.li-feedback-label {
  font: 400 0.74rem/1.2 'Graphik', 'Avenir Next', sans-serif;
  letter-spacing: 0;
  color: rgba(112, 103, 93, 0.76);
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 180ms ease, transform 180ms ease;
  white-space: nowrap;
}

.li-feedback-controls:hover .li-feedback-label,
.li-feedback-shell.is-commenting .li-feedback-label {
  opacity: 1;
  transform: translateX(0);
}

.li-feedback-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.li-feedback-action {
  position: relative;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(185, 177, 166, 0.96);
  cursor: pointer;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.li-feedback-action:hover,
.li-feedback-action:focus-visible {
  color: rgba(112, 103, 93, 0.96);
  border-color: rgba(193, 184, 172, 0.92);
  background: rgba(255, 255, 255, 0.42);
  outline: none;
}

.li-feedback-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.li-feedback-action::before,
.li-feedback-action::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.li-feedback-action::before {
  content: attr(data-tooltip);
  top: -52px;
  transform: translate(-50%, 8px);
  padding: 10px 16px;
  border-radius: 14px;
  border: 1px solid rgba(210, 202, 191, 0.95);
  background: #fff;
  box-shadow: 0 10px 26px rgba(61, 44, 24, 0.09);
  color: #2a2119;
  font: 500 0.78rem/1 'Graphik', 'Avenir Next', sans-serif;
  white-space: nowrap;
}

.li-feedback-action::after {
  content: '';
  top: -10px;
  transform: translate(-50%, 8px) rotate(45deg);
  width: 12px;
  height: 12px;
  border-right: 1px solid rgba(210, 202, 191, 0.95);
  border-bottom: 1px solid rgba(210, 202, 191, 0.95);
  background: #fff;
}

.li-feedback-action:hover::before,
.li-feedback-action:hover::after,
.li-feedback-action:focus-visible::before,
.li-feedback-action:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.li-feedback-shell[data-reaction="not-quite"] .li-feedback-action:not([data-reaction="not-quite"]),
.li-feedback-shell[data-reaction="useful"] .li-feedback-action:not([data-reaction="useful"]),
.li-feedback-shell[data-reaction="loved"] .li-feedback-action:not([data-reaction="loved"]) {
  opacity: 0.15;
}

.li-feedback-shell[data-reaction="not-quite"] .li-feedback-action[data-reaction="not-quite"] {
  color: #5d554c;
  border-color: rgba(206, 198, 188, 0.96);
  background: rgba(245, 239, 232, 0.92);
}

.li-feedback-shell[data-reaction="useful"] .li-feedback-action[data-reaction="useful"] {
  color: #6d8261;
  border-color: rgba(188, 202, 179, 0.98);
  background: rgba(229, 237, 224, 0.94);
}

.li-feedback-shell[data-reaction="loved"] .li-feedback-action[data-reaction="loved"] {
  color: #a55a43;
  border-color: rgba(216, 197, 190, 0.98);
  background: rgba(247, 236, 232, 0.94);
}

.li-feedback-comment-row {
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  width: min(360px, 100%);
}

.li-feedback-comment-row.is-visible {
  display: flex;
}

.li-feedback-comment-input {
  width: min(280px, calc(100vw - 120px));
  border: 0;
  border-bottom: 1px solid rgba(126, 116, 104, 0.5);
  background: transparent;
  color: #2a2119;
  font: 400 0.8rem/1.3 'Graphik', 'Avenir Next', sans-serif;
  padding: 2px 0 8px;
  outline: none;
}

.li-feedback-comment-input::placeholder {
  color: rgba(112, 103, 93, 0.68);
}

.li-feedback-comment-send {
  border: 0;
  background: transparent;
  color: #b44d27;
  font: 600 0.78rem/1 'Graphik', 'Avenir Next', sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
  cursor: pointer;
}

.li-feedback-comment-send.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.li-feedback-comment-send:disabled {
  opacity: 0.38;
  pointer-events: none;
}

@media (hover: none), (pointer: coarse) {
  .li-reader-block--feedback-ready::after {
    display: none;
  }

  .li-reader-block--feedback-commenting {
    padding-bottom: 0;
  }

  .li-feedback-shell {
    position: static;
    top: auto;
    right: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    min-height: 54px;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
    align-items: stretch;
    box-sizing: border-box;
    overflow-x: clip;
  }

  .li-feedback-label {
    display: block;
    opacity: 0.72;
    transform: none;
    font-size: 0.68rem;
    color: rgba(112, 103, 93, 0.7);
    white-space: normal;
    flex: 1 1 auto;
    min-width: 0;
  }

  .li-feedback-action::before,
  .li-feedback-action::after {
    content: none;
  }

  .li-feedback-controls {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    box-sizing: border-box;
  }

  .li-feedback-actions {
    flex: 0 0 auto;
  }

  .li-feedback-comment-row,
  .li-feedback-comment-input {
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 640px) {
  .li-reader-block--warm.li-reader-block--feedback-ready {
    padding-bottom: 22px;
  }

  .li-feedback-controls {
    gap: 10px;
  }

  .li-feedback-actions {
    gap: 10px;
  }

  .li-feedback-comment-row {
    width: 100%;
    gap: 10px;
  }

  .li-feedback-comment-input {
    width: 100%;
  }
}
