/* messages.module.css */

/* Linear-style activity feed shown above the messages */
.activityFeed {
  margin: 12px 0 28px 0;
}

.activityList {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

/* A run of consecutive activity rows (no thread between) — owns the
   vertical timeline that connects the icons. */
.activityRun {
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* Single-item run has no timeline, so it doesn't need vertical breathing room. */
.activityRun .activityItem:only-child {
  padding: 0 4px;
}

.activityItem {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 450;
  color: lch(40% 1 282 / 1);
  letter-spacing: -0.00666667em;
}

/* Vertical connector — only drawn inside a run, so a lone activity between
   threads has no orphan stub. */
.activityRun .activityItem::before,
.activityRun .activityItem::after {
  content: '';
  position: absolute;
  left: 10.5px;
  width: 1px;
  background: #e5e7eb;
}

.activityRun .activityItem::before {
  top: 0;
  height: calc(50% - 9px);
}

.activityRun .activityItem::after {
  bottom: 0;
  height: calc(50% - 9px);
}

.activityRun .activityItem:first-child::before,
.activityRun .activityItem:last-child::after {
  display: none;
}

[data-theme="dark"] .activityRun .activityItem::before,
[data-theme="dark"] .activityRun .activityItem::after {
  background: #2a2a2a;
}

[data-theme="dark"] .activityItem {
  color: #969696;
}

.activityIcon {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #6b7280;
}

.activityIcon > svg {
  width: 14px !important;
  height: 14px !important;
}

[data-theme="dark"] .activityIcon {
  background: transparent;
  color: #969696;
}

.activityAvatar {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 6px;
  font-family: 'Inter', Inter, sans-serif;
}

.activityDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111827;
  display: inline-block;
}

[data-theme="dark"] .activityDot {
  background: #f1f5f9;
}

.activityBody {
  flex: 1;
  min-width: 0;
  color: inherit;
}

.activityBody strong {
  color: lch(40% 1 282 / 1);
  font-weight: 450;
}

.activityTime {
  color: inherit;
}

/* Expand/Collapse button for truncated content */
.expandButton {
  padding: 5px 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  margin-top: 12px;
  font-size: 14px;
  color: #111827;
  font-family: 'Inter', sans-serif;
}

.expandButton:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.expandButton svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.expandButton svg polyline {
  stroke: #575c67;
}

.collapseButton {
  padding: 5px 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  margin-top: 12px;
  font-size: 14px;
  color: #111827;
  font-family: 'Inter', sans-serif;
}

.collapseButton:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.collapseButton svg {
  transform: rotate(180deg);
  transition: transform 0.2s;
}

.collapseButton svg polyline {
  stroke: #575c67;
}

/* Dark mode support - only use data-theme attribute */
[data-theme="dark"] .expandButton {
  background: #2a2a2a;
  border-color: #3a3a3a;
  color: #cbd5e1;
}

[data-theme="dark"] .expandButton:hover {
  background: #333333;
  border-color: #4a4a4a;
}

[data-theme="dark"] .collapseButton {
  background: #2a2a2a;
  border-color: #3a3a3a;
  color: #cbd5e1;
}

[data-theme="dark"] .collapseButton:hover {
  background: #333333;
  border-color: #4a4a4a;
}

[data-theme="dark"] .expandButton svg polyline,
[data-theme="dark"] .collapseButton svg polyline {
  stroke: #cbd5e1;
}

/* Make emojis larger */
@font-face {
  font-family: "emoji";
  src: local('Apple Color Emoji'), local('Android Emoji'), local('Segoe UI Emoji'), local('Noto Color Emoji'), local(EmojiSymbols), local(Symbola);
  unicode-range: U+231A-231B, U+23E9-23EC, U+23F0, U+23F3, U+25FD-25FE, U+2614-2615, U+2648-2653, U+267F, U+2693, U+26A1, U+26AA-26AB, U+26BD-26BE, U+26C4-26C5, U+26CE, U+26D4, U+26EA, U+26F2-26F3, U+26F5, U+26FA, U+26FD, U+2705, U+270A-270B, U+2728, U+274C, U+274E, U+2753-2755, U+2757, U+2795-2797, U+27B0, U+27BF, U+2B1B-2B1C, U+2B50, U+2B55, U+FE0F, U+1F004, U+1F0CF, U+1F18E, U+1F191-1F19A, U+1F1E6-1F1FF, U+1F201, U+1F21A, U+1F22F, U+1F232-1F236, U+1F238-1F23A, U+1F250-1F251, U+1F300-1F320, U+1F32D-1F335, U+1F337-1F393, U+1F3A0-1F3CA, U+1F3CF-1F3D3, U+1F3E0-1F3F0, U+1F3F4, U+1F3F8-1F43E, U+1F440, U+1F442-1F4FC, U+1F4FF-1F53D, U+1F54B-1F567, U+1F57A, U+1F595-1F596, U+1F5A4, U+1F5FB-1F64F, U+1F680-1F6CC, U+1F6D0-1F6D2, U+1F6D5-1F6D7, U+1F6DC-1F6DF, U+1F6EB-1F6EC, U+1F6F4-1F6FC, U+1F7E0-1F7EB, U+1F7F0, U+1F90C-1F93A, U+1F93C-1F945, U+1F947-1FA7C, U+1FA80-1FAC5, U+1FACE-1FADB, U+1FAE0-1FAE8, U+1FAF0-1FAF8;
  size-adjust: 120%;
}

.chatContainer {
  & h1 {
    font-size: 30px;
    font-style: normal;
    font-weight: 500;

    line-height: 38px;
  }
}

.chatInner {
  display: flex;
  flex-direction: column;
  flex: 1;
  @media (width >= 768px) {
    flex-direction: row;
    min-height: calc(100dvh - 55px);
  }
}

.chatLeft {
  flex: 1;
  align-items: flex-start;
  gap: 24px;
  background: #fff;

  @media (width >= 768px) {
    border: 1px solid #eaecf0;
    border-radius: 12px;
    box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
    margin: 22px 0 32px 32px;
  }
}

.chatHeader {
  font-size: 24px;
  padding: 20px;
  border-bottom: 1px solid var(--neutral-200);
  font-size: 18px;
  font-style: normal;
  font-weight: 500;
  line-height: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  @media (width >= 768px) {
    align-items: center;
    flex-direction: row;
    gap: 0px;
    padding: 32px;
  }
}

.chatHeaderActions {
  display: flex;
  gap: 10px;
  @media (width >= 768px) {
    margin-left: auto;
  }
}
.chatSection {
  max-width: 1200px;
  flex: 1;
  padding-bottom: 48px;
  @media (width >= 768px) {
    padding: 0;
  }
}

.userProfile {
  flex: 1;
  border-radius: 12px;
  border: 1px solid #eaecf0;
  background: #fff;
  box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
  align-items: flex-start;
  gap: 24px;
  margin: 22px 10px 32px 10px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: fit-content;
  padding: 48px 0;
  @media (width >= 768px) {
    margin-left: auto;
    max-width: 360px;
    margin: 22px 32px 32px 32px;
  }
  @media (width <= 768px) {
    display: none;
  }
}

.userProfileTyp {
  color: var(--neutral-600);
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
  margin-top: 3px;
  text-align: center;
  border-bottom: 1px solid var(--neutral-200);
  padding-bottom: 32px;
  margin-bottom: 32px;
}

.userProfileSkills {
  margin: 15px 0;
}

.userProfileBio {
  margin-top: 35px;

  & svg {
    width: 18px;
    margin-right: 8px;
  }
}

.userProfileBioLabel {
  color: var(--neutral-700);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 20px;
  margin-bottom: 3px;
}

.userProfileBioText {
  display: flex;
  align-items: center;
  color: var(--neutral-600);
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 20px;
}

.countryFlag {
  margin-top: 10px;
  & img {
    border-radius: 50%;
    width: 20px;
    margin-right: 8px;
  }
  display: flex;
  align-items: center;
}
.skillsContainer {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.skillTag {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border-radius: 20px;
  background: #f4f4f5;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 20px;
  color: #535a6a;
  padding: 5px 12px;

  & img {
    width: 14px;
    height: auto;
    display: flex;
  }

  &:hover {
    color: #151516;
    background: var(--neutral-50);
  }
}
.profileImageContainer {
  position: relative;

  & img {
    width: 108px;
    height: 108px;
    border-radius: 108px;
  }
}

.userProfileImageInitial {
  position: relative;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border-radius: 108px;
  font-size: 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #eaecf0;

  & span {
    background: radial-gradient(
        100% 100% at 0% 0,
        hsla(0, 0%, 100%, 0.51) 0,
        hsla(0, 0%, 100%, 0) 100%
      ),
      #131313;
    background-clip: border-box;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: unset;
    text-transform: uppercase;
  }
}

.userProfileContent {
  padding: 0 1.5rem 1.875rem 1.5rem;
  width: 100%;
  @media (width >= 768px) {
    padding: 0 1.5rem;
  }
}

.userThumbsUp {
  align-items: center;
  border-radius: 20px;
  box-shadow: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  gap: 8px;
  line-height: 20px;
  padding: 8px 16px;
  margin: 20px auto 0 auto;
  transition: all 0.2s ease-in-out;
  background: #000;
  border: 0.939px solid hsla(0, 0%, 100%, 0.2);

  &:hover {
    background: #000;
  }
  & svg {
    color: var(--neutral-500);
    width: 16px;
    height: 16px;
  }
}
.userProfileName {
  color: var(--neutral-900);
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 500;
  line-height: 2rem;
  text-align: center;
}

.messageProfileImage {
  position: relative;
  width: 40px;
  height: 40px;
  &::before {
    content: '';
    display: block;
    border-radius: 12.5rem;
    border: 1px solid #000;
    opacity: 0.08;
    width: 40px;
    height: 40px;
    border-radius: 33px;
    position: absolute;
    left: 0px;
    top: 0px;
  }
}

.messageProfileImageInitial {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 40px;
  font-size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #eaecf0;

  & span {
    background: radial-gradient(
        100% 100% at 0% 0,
        hsla(0, 0%, 100%, 0.51) 0,
        hsla(0, 0%, 100%, 0) 100%
      ),
      #131313;
    background-clip: border-box;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: unset;
    text-transform: uppercase;
  }
}

.messageProfileImageAssistant {
  border: none;
  cursor: pointer;
  display: flex;
  gap: 8px;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
  position: relative;
  justify-content: center;
  align-items: center;
  flex: 0 0 40px;
  border: 1px solid #d0d5dd;

  &::after {
    content: '';
    display: flex;
    z-index: 2;
    width: 37px;
    height: 37px;
    background: #fff;
    border-radius: 20px !important;
    position: absolute;
  }
}
.profileChatImage {
  width: 40px;
  height: 40px;
  border-radius: 40px;
  max-inline-size: 40px;
}

.profileChatImageAssistant {
  width: 20px;
  height: 20px;
  z-index: 3;
}
.chatTitle {
  text-align: center;
  margin-bottom: 20px;
}

.chatMessages {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
  /* top/bottom breathing room as margin (outside the masked viewport);
     no horizontal padding */
  margin: 0 0 16px;
  padding: 24px 24px 6px 24px;
  flex: 1;
  gap: 20px;
  /* mask-image is computed inline (edge fades depend on scroll position). */
}

/* Pin short content to the bottom (like justify-content: flex-end) without
   clipping when it overflows: the auto margin collapses to 0 once the content
   is taller than the viewport, so the top stays scrollable. */
.chatMessages > :first-child {
  margin-top: auto;
}

/* Skeleton loading for message cards */
.messagesSkeleton {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
}

.skeletonCard {
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeletonContent {
  display: flex;
}

[data-theme="dark"] .skeletonCard {
  border: 1px solid #1f1f20;
  background: #171717;
  box-shadow: none;
}

.skeletonAvatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite ease-in-out;
  flex-shrink: 0;
}

[data-theme="dark"] .skeletonAvatar {
  background: linear-gradient(90deg, #2a2a2a 0%, #404040 50%, #2a2a2a 100%);
  background-size: 200% 100%;
}

.skeletonContent {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeletonLine {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite ease-in-out;
}

[data-theme="dark"] .skeletonLine {
  background: linear-gradient(90deg, #2a2a2a 0%, #404040 50%, #2a2a2a 100%);
  background-size: 200% 100%;
}

.skeletonName {
  width: 120px;
  height: 10px;
  opacity: 0.7;
}

.skeletonText1 {
  width: 90%;
}

.skeletonText2 {
  width: 70%;
}

/* Activity Feed Skeleton */
.activitySkeleton {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.activitySkeletonItem {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0px;
  max-width: 280px;
}

.activitySkeletonItem::before,
.activitySkeletonItem::after {
  content: '';
  position: absolute;
  left: 7px;
  width: 1px;
  background: #e5e7eb;
}

.activitySkeletonItem::before {
  top: 0;
  left: 6px;
  height: calc(50% - 7px);
}

.activitySkeletonItem::after {
  bottom: 0;
  left: 6px;
  height: calc(50% - 7px);
}

.activitySkeletonItem:first-child::before,
.activitySkeletonItem:last-child::after {
  display: none;
}

[data-theme="dark"] .activitySkeletonItem::before,
[data-theme="dark"] .activitySkeletonItem::after {
  background: #2a2a2a;
}

.activitySkeletonAvatar {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite ease-in-out;
  flex-shrink: 0;
}

[data-theme="dark"] .activitySkeletonAvatar {
  background: linear-gradient(90deg, #2a2a2a 0%, #404040 50%, #2a2a2a 100%);
  background-size: 200% 100%;
}

.activitySkeletonText {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite ease-in-out;
}

[data-theme="dark"] .activitySkeletonText {
  background: linear-gradient(90deg, #2a2a2a 0%, #404040 50%, #2a2a2a 100%);
  background-size: 200% 100%;
}

.activitySkeletonTime {
  width: 50px;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite ease-in-out;
}

[data-theme="dark"] .activitySkeletonTime {
  background: linear-gradient(90deg, #2a2a2a 0%, #404040 50%, #2a2a2a 100%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Each top-level comment (thread) is its own card */
.threadCard {
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .threadCard {
  background: #171717;
  border: 1px solid #1f1f20;
  box-shadow: none;
}

/* Per-card reply input (last row inside a comment card) */
.threadReply {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 7px 0 16px;
}

.threadReplyRow {
  display: flex;
  align-items: flex-end;
  gap: 0px;

  .threadReplyIcon[aria-label="Attach file"] svg {
    margin-top: 2px;
  }

}

.threadReplyActions {
  display: flex;
  align-items: flex-end;
  gap: 0px;
  padding-bottom: 5px;
}

.threadReplyFiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 18px;
}

.threadReplyChip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 4px 6px 4px 10px;
  border-radius: 8px;
  background: #f3f4f6;
  font-size: 12px;
  color: #374151;
}

[data-theme="dark"] .threadReplyChip {
  background: #2a2a2a;
  color: #cbd5e1;
}

.threadReplyChipName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Image attachment shown directly as a thumbnail in the reply composer */
.threadReplyImage {
  position: relative;
  display: block;
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  line-height: 0;
}

[data-theme="dark"] .threadReplyImage {
  border-color: rgba(255, 255, 255, 0.08);
}

.threadReplyImage img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
}

.threadReplyImageRemove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  padding: 0;
}

.threadReplyImageRemove:hover {
  background: rgba(0, 0, 0, 0.75);
}

.threadReplyChipRemove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #a3a3a3;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  flex-shrink: 0;
}

.threadReplyChipRemove:hover {
  color: #374151;
}

[data-theme="dark"] .threadReplyChipRemove:hover {
  color: #e5e7eb;
}

.threadReplyAvatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}

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

.threadReplyInputWrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.commentEditorWrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.threadReplyInput {
  width: 100%;
  min-width: 0;
  border: none;
  min-height: 24px;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: lch(20% 1 282 / 1);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, emoji;
  resize: none;
  overflow-y: hidden;
  line-height: 1.6;
  padding: 0;
  display: block;
  font-weight: 450;
  letter-spacing: -.00666667em;
}

[data-theme="dark"] .threadReplyInput {
  color: #e5e7eb;
}

.threadReplyInput::placeholder {
  color: #a3a3a3;
}

.threadReplyIcon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.threadReplyRow .threadReplyIcon::first-child {
  svg {
    margin-top: 2px;
  }
}

[data-theme="dark"] .threadReplyIcon {
  color: #969696;
}

.threadReplyIcon:hover:not(:disabled) {
  color: #4b5563;
  background: #f3f4f6;
}

.threadReplyIcon:disabled {
  cursor: default;
  opacity: 0.5;
}

.threadReplyIconActive {
  color: #6b7280;
}

[data-theme="dark"] .threadReplyIcon:hover:not(:disabled) {
  color: #e5e7eb;
  background: #232323;
}

[data-theme="dark"] .threadReplyIconActive {
  color: #cbd5e1;
}

/* "…" context menu for message actions — TipTap slash-menu / assign-dropdown style */
.messageMoreMenu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 1000;
  min-width: 184px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fff;
  border: none;
  border-radius: 8px;
  box-shadow: 0px 8px 12px 0px rgba(0, 0, 0, 0.08), 0px 0px 1px 0px rgba(0, 0, 0, 0.62);
}

[data-theme="dark"] .messageMoreMenu {
  background: #1f1f1f;
  border: 1px solid #3a3a3a;
  box-shadow: 0px 8px 12px 0px rgba(0, 0, 0, 0.08), 0px 0px 1px 0px rgba(0, 0, 0, 0.62);
}

.messageMoreMenuItem {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-size: 13px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Rounded', Inter, sans-serif;
  color: #1c1c1c;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}

.messageMoreMenuItem svg {
  flex-shrink: 0;
  color: #6b7280;
}

.messageMoreMenuItem:hover {
  background: #f5f5f5;
}

[data-theme="dark"] .messageMoreMenuItem {
  color: #f1f5f9;
}

[data-theme="dark"] .messageMoreMenuItem svg {
  color: #cdcdcd;
}

[data-theme="dark"] .messageMoreMenuItem:hover {
  background: #2a2a2a;
}

.messageMoreMenuItemDanger,
.messageMoreMenuItemDanger svg {
  color: #dc2626;
}

.messageMoreMenuItemDanger:hover {
  background: #fef2f2;
}

[data-theme="dark"] .messageMoreMenuItemDanger,
[data-theme="dark"] .messageMoreMenuItemDanger svg {
  color: #f87171;
}

[data-theme="dark"] .messageMoreMenuItemDanger:hover {
  background: rgba(248, 113, 113, 0.12);
}

.chatMessage {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  display: block;
  position: relative;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  .messageContent {
    padding: 2px 0 0 0;
    border: none;
    background: transparent;
    border-radius: 0;
    color: lch(20% 1 282 / 1);
    font-size: 14px;
    font-weight: 450;
    letter-spacing: -0.00666667em;
    line-height: 1.6;
    transition: color 0.2s ease;
    word-break: break-word;
    overflow-wrap: anywhere; /* better URL breaking */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, emoji;
    max-width: 100%;
  }
}

/* Links in messages */
.messageContent a {
  color: #f84b2f;
    font-weight: 450;
    letter-spacing: -0.00666667em;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
  word-break: break-all; /* Better URL breaking */
}

.messageContent a:hover {
  color: #d93d23;
  text-decoration: underline;
}

[data-theme="dark"] .messageContent a {
  color: #f84b2f;
  text-decoration: underline;
}

[data-theme="dark"] .messageContent a:hover {
  color: #ff6a52;
  text-decoration: underline;
}

/* (Old bubble dark styles removed — flat feed handles message content below) */

[data-theme="dark"] .userName {
  color: #f1f5f9;
}

[data-theme="dark"] .messageDate {
  color: #cbd5e1;
}

[data-theme="dark"] .chatLeft {
  background: #171717;
  border-color: #2a2a2a;
}

[data-theme="dark"] .chatHeader {
  border-bottom-color: #2a2a2a;
  color: #f1f5f9;
}

[data-theme="dark"] .userProfile {
  background: #171717;
  border-color: #2a2a2a;
}

[data-theme="dark"] .userProfileName {
  color: #f1f5f9;
}

[data-theme="dark"] .userProfileTyp {
  color: #969696;
  border-bottom-color: #2a2a2a;
}

[data-theme="dark"] .userProfileBioLabel {
  color: #cbd5e1;
}

[data-theme="dark"] .userProfileBioText {
  color: #969696;
}

[data-theme="dark"] .skillTag {
  background: #1f1f1f;
  color: #cbd5e1;
  border: 1px solid #2a2a2a;
}

[data-theme="dark"] .skillTag:hover {
  background: #2a2a2a;
  color: #f1f5f9;
}

[data-theme="dark"] .chatAiButton {
  background: #1f1f1f;
  border-color: #2a2a2a;
  color: #cbd5e1;
}

[data-theme="dark"] .chatAiButton:hover {
  background: #2a2a2a;
}

[data-theme="dark"] .deleteButton {
  background: #1f1f1f;
  border-color: #2a2a2a;
  color: #cbd5e1;
}

[data-theme="dark"] .deleteButton:hover {
  background: #2a2a2a;
}

[data-theme="dark"] .deleteButton svg {
  color: #cbd5e1;
}

[data-theme="dark"] .chatLinkButton {
  background: #1f1f1f;
  color: #cbd5e1;
}

[data-theme="dark"] .chatLinkButton:hover {
  background: #2a2a2a;
  color: #f1f5f9;
}

[data-theme="dark"] .chatSendButton {
  background: #b397ff;
  border-color: #6d28d9;
}

[data-theme="dark"] .messageLimitInfo {
  background: #1f1f1f;
}

[data-theme="dark"] .messageLimitHeadline {
  color: #f1f5f9;
}

[data-theme="dark"] .messageLimitText {
  color: #969696;
}

[data-theme="dark"] .messageLimitButton {
  background: #b397ff;
}

[data-theme="dark"] .messageLimitButton:hover {
  background: #6d28d9;
}

[data-theme="dark"] .messageProfileImageInitial {
  background: #2a2a2a;
}

[data-theme="dark"] .userProfileImageInitial {
  background: #2a2a2a;
}

.messageEditButton {
  background: none;
  border: none;
  cursor: pointer;
  color: #4b5563;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  padding: 0;
  text-decoration: underline;
}

[data-theme="dark"] .messageEditButton {
  color: #cbd5e1;
}

.messageDeleteButton {
  background: none;
  border: none;
  cursor: pointer;
  color: #4b5563;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  padding: 0;
  text-decoration: underline;
}

[data-theme="dark"] .messageDeleteButton {
  color: #cbd5e1;
}

.messageEditedLabel {
  font-size: 12px;
  color: #969696;
  font-family: 'Inter', sans-serif;
}

[data-theme="dark"] .messageEditedLabel {
  color: #969696;
}

.mention {
  background: transparent;
  color: lch(20% 1 282 / 1);
    letter-spacing: -0.00666667em;
  font-weight: 600;
  cursor: pointer;
  vertical-align: baseline;
  border-radius: 3px;
  padding: 0;
  transition: background-color 0.15s ease;
}

.mention:hover {
  background: #f3f4f6;
}

/* Only add spacing when mentions are on consecutive lines */
.messageContent div:has(.mention) + div:has(.mention) {
  margin-top: 4px;
}

[data-theme="dark"] .mention {
  background: transparent;
  color: #f1f5f9;
}

[data-theme="dark"] .mention:hover {
  background: #2a2a2a;
}

.mentionDropdown {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: auto;
  margin-bottom: 8px;
  background: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0px 8px 12px 0px rgba(0, 0, 0, 0.08), 0px 0px 1px 0px rgba(0, 0, 0, 0.62);
  max-height: 300px;
  overflow-y: auto;
  z-index: 10000;
  width: 280px;
  max-width: 280px;
  transition: all 0.3s ease;
}

.mentionDropdownBelow {
  top: calc(100% + 8px);
  bottom: auto;
  margin-top: 0;
  margin-bottom: 0;
}

[data-theme="dark"] .mentionDropdown {
  background: #1f1f1f;
  border: 1px solid #3a3a3a;
  box-shadow: 0px 8px 12px 0px rgba(0, 0, 0, 0.08), 0px 0px 1px 0px rgba(0, 0, 0, 0.62);
}

.mentionItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
  border-bottom: 1px solid #f3f4f6;
}

[data-theme="dark"] .mentionItem {
  border-bottom-color: #2a2a2a;
}

.mentionItem:last-child {
  border-bottom: none;
}

.mentionItem:hover {
  background: #f9fafb;
}

[data-theme="dark"] .mentionItem:hover {
  background: #2a2a2a;
}

.mentionItemSelected {
  background: #f9fafb;
}

[data-theme="dark"] .mentionItemSelected {
  background: #2a2a2a;
}

.mentionUserAvatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.mentionUserInitials {
  width: 24px;
  height: 24px;
  border-radius: 50%;
 background: #e5e7eb;
color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 400;
  transition: all 0.3s ease;
}

[data-theme="dark"] .mentionUserInitials {
  background: #b397ff;
  color: #282a46;
  border-color: #9377bf;
}

.mentionUserInfo {
  flex: 1;
  min-width: 0;
}

.mentionUserName {
  font-size: 14px;
  font-weight: 450;
  color: lch(20% 1 282 / 1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
    letter-spacing: -.00666667em;
}

[data-theme="dark"] .mentionUserName {
  color: #f1f5f9;
}

.mentionUserEmail {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  font-weight: 450;
  letter-spacing: -.00666667em;
  transition: color 0.3s ease;
}

[data-theme="dark"] .mentionUserEmail {
  color: #969696;
}

.mentionNoResults {
  padding: 12px;
  text-align: center;
  color: #969696;
  font-size: 14px;
  transition: color 0.3s ease;
}

[data-theme="dark"] .mentionNoResults {
  color: #969696;
}

.chatMessageOwn {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-self: stretch;
  display: block;
  position: relative;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;

  .messageContent {
    padding: 2px 0 0 0;
    border: none;
    background: transparent;
    border-radius: 0;
    font-size: 14px;
    font-weight: 450;
    letter-spacing: -0.00666667em;
    color: lch(20% 1 282 / 1);
    line-height: 22px;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, emoji;
  }
}

/* Flat-feed dividers + text colour in dark mode */
[data-theme="dark"] .chatMessage,
[data-theme="dark"] .chatMessageOwn {
  border-bottom-color: #1f1f20;
}

[data-theme="dark"] .chatMessage .messageContent,
[data-theme="dark"] .chatMessageOwn .messageContent {
  color: #e5e7eb;
  background: transparent;
}

/* Links in own messages */
.chatMessageOwn .messageContent a {
color: #f84b2f;
    font-weight: 450;
    letter-spacing: -0.00666667em;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
  word-break: break-all;
}

.chatMessageOwn .messageContent a:hover {
  color: #d93d23;
  text-decoration: underline;
}

[data-theme="dark"] .chatMessageOwn .messageContent a {
  color: #f84b2f;
  text-decoration: underline;
}

[data-theme="dark"] .chatMessageOwn .messageContent a:hover {
  color: #ff6a52;
  text-decoration: underline;
}

.userName {
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: lch(20% 1 282 / 1);
  letter-spacing: -0.00666667em;
  font-weight: 550;
  line-height: 20px;
  margin-top: -1px;
}

[data-theme="dark"] .userName {
  color: #f1f5f9;
}

.tooltip {
  position: absolute;
  background-color: white;
  color: black;
  border: 1px solid #ddd;
  padding: 12px;
  z-index: 1000;
  opacity: 1;
  color: var(--neutral-600);
  display: none;
  border-radius: 16px;
  border: 1px solid #e7e7e7;
  box-shadow: 0 10px 30px 0 rgba(16, 24, 40, 0.1);
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: scroll;
}

.messageDate {
  color: lch(40% 1 282 / 1);
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
  line-height: 20px;
}

.messageHeader {
  display: flex;
  margin-bottom: 6px;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
}

.messageHeaderLeft {
  display: flex;
  align-items: center;
  gap: 8px;
}

.messageHeaderRight {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.messageActions {
  display: flex;
  gap: 12px;
}

/* Message Actions Panel - Slack Style */
.messageActionsPanel {
  position: absolute;
  top: 3px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: transparent;
  z-index: 10;
  transition: all 0.2s ease;
  white-space: nowrap;
  width: auto;
}

[data-theme="dark"] .messageActionsPanel {
  background: transparent;
  border: none;
  color: #fff;
}

.actionButton {
  display: flex;
  align-items: center;
  height: 32px;
  background: transparent;
  border: none;
  color: #111827;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 12px;
  gap: 6px;
  transition: all 0.15s ease;
  position: relative;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Rounded", Inter, sans-serif;
  flex-shrink: 0;
  white-space: nowrap;

  & svg {
    color: #6b7280;
    width: 14px;
    height: 14px;
    min-width: 18px;
  }
}

.actionButton:hover {
  background: transparent;
  color: #334155;
}

.actionButton:hover svg {
  color: #334155;
}

[data-theme="dark"] .actionButton {
  color: #e5e7eb;
  background: transparent;
}

[data-theme="dark"] .actionButton svg {
  color: #e5e7eb;
}

[data-theme="dark"] .actionButton:hover {
  background: transparent;
  color: #ffffff;
}

[data-theme="dark"] .actionButton:hover svg {
  color: #ffffff;
}

.actionButton svg {
  width: 16px;
  height: 16px;
}

.actionButtonActive {
  background: #f3f4f6;
  color: #334155;
}

[data-theme="dark"] .actionButtonActive {
  background: #2a2a2a;
  color: #60a5fa;
}

.messageAvatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.messageAvatarInitials {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0px;
  flex-shrink: 0;
  background: #e5e7eb;
  color: #111827;
  font-family: 'Inter', sans-serif;
}

[data-theme="dark"] .messageAvatarInitials {
  background: #b397ff17;
  border: 1px solid #b397ff17;
  color: #b397ff;
}

.messageHeaderAvatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  font-family: Inter,sans-serif;
  font-size: 8px;
  font-weight: 600;
  font-size: 8px;
}

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

[data-avatar-mode="image"] .messageHeaderAvatar {
  width: 18px;
  height: 18px;
}
.chatInputContainer {
  margin-top: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: #fafafa;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 12px 16px;
  transition: all 0.2s ease;
  @media (width >= 768px) {
    padding: 12px 16px;
  }
}

.chatInputContainer:focus-within {
  background-color: #fff;
}

[data-theme="dark"] .chatInputContainer {
  border-color: #2c2c2c;
  background: #1c1c1c;
  box-shadow: none;
}

[data-theme="dark"] .chatInputContainer:focus-within {
  border-color: #313131;
}

/* Message input button container */
.messageInputButtons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

/* Left button group — loose icons, no shared container */
.messageInputButtonsLeft {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.messageInputButtonsLeft > button {
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 0 !important;
}

.messageInputButtonsLeft > button.messageIconButton svg {
  width: 19px;
  height: 19px;
}



/* Individual icon buttons */
.messageIconButton {
  padding: 3px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 50%;
  width: 19px;
  height: 28px;
  transition: all 0.2s;
  color: #111827;
  position: relative;
}

/* Tooltip for attachment button */
.messageIconButton::before {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: #313131;
  color: white;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Rounded", Inter, sans-serif;
}

/* Special positioning for first button (attachment) tooltip */
.messageInputButtonsLeft .messageIconButton:first-child::before {
  left: 0;
  transform: translateX(0);
}

.messageIconButton:hover::before {
  opacity: 1;
}

[data-theme="dark"] .messageIconButton::before {
  background: rgba(255, 255, 255, 0.9);
  color: #1f1f1f;
}

/* Special positioning for first button (attachment) tooltip in dark mode */
[data-theme="dark"] .messageInputButtonsLeft .messageIconButton:first-child::before {
  left: 0;
  transform: translateX(0);
}


.messageIconButtonSecondary {
  padding: 3px;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 50%;
  width: 19px;
  height: 24px;
  transition: all 0.2s;
  color: #111827;
  position: relative;

  & svg {
    width: 16px;
    height: 16px;
  }
}

.messageIconButtonSecondary:hover {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .messageIconButtonSecondary {
   color: #949496;
}

[data-theme="dark"] .messageIconButtonSecondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Tooltip for icon buttons */
.messageIconButtonSecondary::before {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: #313131;
  color: white;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Rounded", Inter, sans-serif;
}

.messageIconButtonSecondary:hover::before {
  opacity: 1;
}

[data-theme="dark"] .messageIconButtonSecondary::before {
  background: rgba(255, 255, 255, 0.9);
  color: #1f1f1f;
}

.messageIconButton:hover {
  background: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .messageIconButton {
  background: rgba(123, 123, 123, 0.1);
  border: 1px solid rgba(106, 106, 106, 0.2);
  color: #949496;
}

[data-theme="dark"] .messageIconButton:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Send button — segmented-group card style to match .messageInputButtonsLeft */
.messageSendButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  padding: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  color: #111827;
}

.messageSendButton:hover:not(:disabled) {
  background: #f9fafb;
}

.messageSendButton.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #ffffff;
  cursor: pointer;
}

.messageSendButton.active:hover {
  background: #4d4d52;
  border-color: var(--primary, #2563eb);
}

.messageSendButton:not(.active) {
  cursor: default;
}

[data-theme="dark"] .messageSendButton {
  background: #262626;
  color: #cbd5e1;
  border-color: #2e2e2e;
}

[data-theme="dark"] .messageSendButton:hover:not(:disabled):not(.active) {
  background: #333333;
  border-color: #525252;
}

[data-theme="dark"] .messageSendButton.active {
  background: #fff;
  border-color: #fff;
  color: #0f172a;
}

[data-theme="dark"] .messageSendButton.active:hover {
  opacity: 0.9;
}

/* Container styles when dragging files */
.chatInputContainerDragging {
  border: 2px dashed #d5d5d5 !important;
  background-color: #f9f9f9 !important;
  padding: 11px !important;
}

[data-theme="dark"] .chatInputContainerDragging {
  border: 2px dashed #3a3a3a !important;
  background-color: #2a2a2a !important;
}

.messageLimitInfo {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #f5f4f7;
  padding: 48px 0;
  border-radius: 13px;
}

.messageLimitHeadline {
  font-size: 18px;
  font-family: 'Inter', sans-serif;
  color: #111827;
}
.messageLimitText {
  font-size: 14px;
  color: #6b7280;
  margin-top: 8px;
  max-width: 400px;
  text-align: center;
}
.messageLimitButton {
  padding: 8px 16px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: #fff;
  background: #111827;
  border-radius: 8px;
  transition: background-color 0.2s ease;
  margin-top: 16px;
  cursor: pointer;
  max-width: 200px;
  text-align: center;
}

.chatInput {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 14px;
  line-height: 1.6;
  min-height: 40px;
  max-height: 200px;
  resize: none;
  overflow: auto;
   color: lch(20% 1 282 / 1);
    font-weight: 450;
    letter-spacing: -0.00666667em;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, emoji;

  &:focus {
    outline: none;
  }

  &::placeholder {
    color: #595959;
    font-weight: 450;
    letter-spacing: -0.00666667em;
  }
}

.chatAiButton {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  line-height: 20px;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #151516;
  box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
  display: flex;
  gap: 8px;
  align-items: center;
  transition: all 0.2s ease-in-out;

  &:hover {
    background: #f5f7f9;
  }
  & svg {
    color: var(--neutral-500);
    width: 18px;
    height: 18px;
  }
}

.chatMessageAddon .messageContent {
  background: #131313;
  color: #4b5563;
  box-shadow: 0 0 0 1px rgba(0,0,0,.04),0 2px 4px rgba(0,0,0,.06),0 8px 12px rgba(0,0,0,.04);
  padding: 24px;
  min-width: 300px;
}

.chatMessageAddonHeadline {
  font-size: 20px;
  font-weight: 500;
  color: #fff;
}

.chatMessageAddonIcon {
  display: inline-flex;
  margin-bottom: 20px;
}
.acceptButton {
  background: #ffffff24;
  border: 0.939px solid hsla(0, 0%, 100%, 0.12);
  border-radius: 26.282px;
  color: #fff;
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  line-height: 160%;
  padding: 8px 15.018px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin-top: 20px;

  &:hover {
    background: #ffffff12;
  }

  & svg {
    width: 18px;
    height: 18px;
  }
}

.acceptedStatus {
  font-weight: 500;
  margin-top: 12px;
  display: block;
  border-top: 1px solid #303131;
  padding-top: 12px;
  margin-bottom: 4px;
}

.chatSendButton {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #000;
  color: #fff;
  cursor: pointer;
  width: 38px;
  height: 38px;
  position: absolute;
  right: 5px;
  display: none;

  @media (width >= 768px) {
    right: 5px;
  }

  & svg {
    width: 18px;
    height: 18px;
  }
}

.chatMessageAddonLink {
  background: #ffffff24;
  border: 0.939px solid hsla(0, 0%, 100%, 0.12);
  border-radius: 26.282px;
  color: #fff;
  font-size: 14px;
  font-style: normal;
  font-weight: 500;
  line-height: 160%;
  padding: 8px 15.018px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin-top: 20px;

  &:hover {
    background: #ffffff12;
  }

  & svg {
    width: 18px;
    height: 18px;
  }
}

.chatLinkButton {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #fff;
  color: #151516;
  border-radius: 40px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  position: absolute;
  right: 80px;
  transition: all 0.2s ease-in-out;

  @media (width >= 768px) {
    right: 85px;
  }

  &:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
  }

  & svg {
    width: 20px;
    height: 20px;
  }
}

.deleteButton {
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-style: normal;
  font-weight: var(--weight-bold);
  line-height: 20px;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #151516;
  box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
  display: flex;
  gap: 8px;
  align-items: center;
  width: 38px;
  height: 38px;
  justify-content: center;
  transition: all 0.2s ease-in-out;
  &:hover {
    background: #f5f7f9;
  }

  & svg {
    color: var(--neutral-500);
    width: 18px;
    height: 18px;
  }
}

/* Dark Mode Styles */
[data-theme="dark"] .chatInput {
  color: #e5e7eb;
}

[data-theme="dark"] .chatInput::placeholder {
   color: #e5e7eb;
}

/* Message Reactions Container */
.messageReactionsContainer {
  margin-top: 6px;
  min-height: 24px;
}

/* Message Edit Buttons */
.messageEditSaveButton {
  background: #111827;
  color: #fff;
  padding: 4px 12px;
  font-size: 14px;
  
  border: 1px solid #111827;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  font-family: 'Inter', sans-serif;
}

.messageEditSaveButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.messageEditSaveButton:hover:not(:disabled) {
  background: #000;
  border-color: #000;
}

.messageEditCancelButton {
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  color: #111827;
  padding: 4px 12px;
  font-size: 14px;
  
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.messageEditCancelButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.messageEditCancelButton:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #c4c4c4;
}

[data-theme="dark"] .messageEditCancelButton {
  background: #1f1f1f;
  border-color: #2a2a2a;
  color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}

[data-theme="dark"] .messageEditCancelButton:hover:not(:disabled) {
  background: #2a2a2a;
  border-color: #3a3a3a;
}

.messageEditButtonsContainer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.messageEditWrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  box-sizing: border-box;
  position: relative;
}

.messageEditInput {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 450;
  letter-spacing: -.00666667em;
  color: lch(20% 1 282/1);
  line-height: 1.6;
  min-height: 36px;
  resize: none;
  overflow: auto;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, emoji;
  outline: none;
  box-sizing: border-box;
  padding-top: 2px;
  padding-right: 8px;
}

.messageEditInput::placeholder {
  color: #595959;
}

.messageEditInput:focus {
  outline: none;
}

[data-theme="dark"] .messageEditWrapper {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

[data-theme="dark"] .messageEditInput {
  color: #fcfcfc;
}

[data-theme="dark"] .messageEditInput::placeholder {
  color: #969696;
}

/* Expand message bubble to full width while editing */
.chatMessageEditing {
  max-width: 100% !important;
  width: 100% !important;
  align-self: stretch !important;
  justify-content: flex-start !important;
}

.chatMessageEditing > div {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.chatMessageEditing .messageContentWrapper {
  width: 100%;
  min-width: 0;
}

.chatMessageEditing .messageContent {
  width: 100%;
  flex: 1 1 auto;
  min-width: 0;
  background: transparent !important;
  border: 0 !important;
  padding: 0;
}

/* Dark mode for message edit buttons */
[data-theme="dark"] .messageEditSaveButton {
  color: #fff;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.3);
}

[data-theme="dark"] .messageEditSaveButton:hover:not(:disabled) {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

[data-theme="dark"] .messageEditCancelButton {
  color: #fff;
  background: #1f1f1f;
  border: 1px solid #2a2a2a;
  box-shadow: 0 1px 2px 0 rgba(0,0,0,.3);
}

[data-theme="dark"] .messageEditCancelButton:hover:not(:disabled) {
  background: #2a2a2a;
  border-color: #3a3a3a;
}

/* Reply functionality styles */
.replyPreview {
  background: #f5f4f7;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}

[data-theme="dark"] .replyPreview {
  background: #2a2a2a;
  border-left-color: #a78bfa;
}

.replyPreviewContent {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.replyPreviewHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.replyingTo {
  font-size: 14px;
  color: #111827;
   font-family: 'Inter', sans-serif;
}

[data-theme="dark"] .replyingTo {
  color: #969696;
}

.cancelReplyButton {
  background: #fff;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  color: #111827;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.cancelReplyButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cancelReplyButton:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #c4c4c4;
}

[data-theme="dark"] .cancelReplyButton {
  background: #1f1f1f;
  border-color: #2a2a2a;
  color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(0,0,0,.3);
}

[data-theme="dark"] .cancelReplyButton:hover:not(:disabled) {
  background: #2a2a2a;
  border-color: #3a3a3a;
}

.replyPreviewMessage {
  font-size: 13px;
  color: #374151;
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
}

[data-theme="dark"] .replyPreviewMessage {
  color: #d1d5db;
}

/* Reply reference in messages */
.replyReference {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #6b7280;
  max-width: 100%;
  overflow: hidden;
}

[data-theme="dark"] .replyReference {
  color: #969696;
}

.replyIcon {
  opacity: 0.5;
}

[data-theme="dark"] .replyIcon {
  opacity: 1;
  color: #cbd5e1;
}

.replyReferenceContent {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.replyReferenceSender {
  font-size: 12px;
  font-weight: 500;
  color: #111827;
  flex-shrink: 0;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.replyReferenceSender::after {
  content: ':';
  margin-left: 2px;
}

[data-theme="dark"] .replyReferenceSender {
  color: #e5e7eb;
}

.replyReferenceText {
  font-size: 12px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
}

[data-theme="dark"] .replyReferenceText {
  color: #e5e7eb;
  opacity: 0.6;
}

/* Message Content Wrapper */
.messageContentWrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  min-width: 0;
}

/* File Attachment Cards in Messages */
.messageFileCards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
  min-width: 240px;
}

.messageFileCard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: transparent;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 320px;
}


[data-theme="dark"] .messageFileCard {
  background: #262626;
  border-color: #2e2e2e;
}

[data-theme="dark"] .messageFileCard:hover {
  background: #262626;
  color: #cbd5e1;
  border-color: #2e2e2e;
}

.messageFileBadge {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: #111827;
  border: 1px solid #111827;
  color: #fff;
  transition: all 0.2s ease;
}

.messageFileBadge svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] .messageFileBadge {
  background: #1c1c1c;
  border-color: #2c2c2c;  
}



.messageFileIcon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  transition: all 0.2s ease;
}

[data-theme="dark"] .messageFileIcon {
  background-color: #1c1c1c;
  border-color: #2c2c2c;
  box-shadow: none;
}

.messageFileIcon svg {
  width: 18px;
  height: 18px;
  color: #111827;
  transition: color 0.3s ease;
}

[data-theme="dark"] .messageFileIcon svg {
  color: #cbd5e1;
}

.messageFileInfo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.messageFileName {
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: lch(20% 1 282 / 1);
  letter-spacing: -0.00666667em;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="dark"] .messageFileName {
  color: #e5e7eb;
}

.messageFileSize {
  font-size: 12px;
  color: #6b7280;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 450;
  letter-spacing: -0.00666667em;
}

[data-theme="dark"] .messageFileSize {
  color: #969696;
}

.messageFileActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.messageFileDownload {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #6b7280;
  transition: color 0.12s ease;
  flex-shrink: 0;
}

.messageFileDownload:hover {
  color: #111827;
}

[data-theme="dark"] .messageFileDownload {
  color: #969696;
}

[data-theme="dark"] .messageFileDownload:hover {
  color: #f1f5f9;
}

.messageFileDownload svg {
  width: 16px;
  height: 16px;
  color: currentColor;
}

/* Image attachments in messages */
.messageImageCard {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  max-width: 300px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.messageImageCard:not(:last-of-type) {
  margin-bottom: 8px;

}

.messageImageCard:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .messageImageCard {
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .messageImageCard:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.messageImageCard img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: cover;
}

/* Skeleton shown while a message image is still loading (removed on load) */
@keyframes msgShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.messageImageCardLoading {
  min-height: 160px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: msgShimmer 1.5s infinite;
}

[data-theme="dark"] .messageImageCardLoading {
  background: linear-gradient(90deg, #2a2a2a 25%, #505050 50%, #2a2a2a 75%);
  background-size: 200% 100%;
}

.messageImageCardLoading img {
  opacity: 0;
}



/* -------------------------------------------------------------------------
   Rich-text comment editors (CommentEditor). The wrapper keeps the old input
   sizing (.chatInput / .threadReplyInput / .messageEditInput); the inner
   ProseMirror just needs to look like editable text.
   ------------------------------------------------------------------------- */
.chatInput :global(.ProseMirror),
.threadReplyInput :global(.ProseMirror),
.messageEditInput :global(.ProseMirror) {
  outline: none;
  min-height: 24px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, emoji;
  font-size: 14px;
  font-weight: 450;
  letter-spacing: -.00666667em;
  color: lch(20% 1 282 / 1);
}



.chatInput .ProseMirror ol li,
.threadReplyInput ol li,
.messageEditInput ol li {
  list-style-type: decimal;
}

[data-theme="dark"] .chatInput :global(.ProseMirror),
[data-theme="dark"] .threadReplyInput :global(.ProseMirror),
[data-theme="dark"] .messageEditInput :global(.ProseMirror) {
  color: #e5e7eb;
}

.threadReplyInput :global(.ProseMirror) {
    padding: 8px 0 8px 0;
}

.chatInput :global(.ProseMirror a),
.threadReplyInput :global(.ProseMirror a),
.messageEditInput :global(.ProseMirror a) {
color: #f84b2f;
  font-weight: 450;
  letter-spacing: -0.00666667em;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
  word-break: break-all;
}

.chatInput :global(.ProseMirror p),
.threadReplyInput :global(.ProseMirror p),
.messageEditInput :global(.ProseMirror p) {
  margin: 0 0 8px 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, emoji;
  font-size: 14px;
  font-weight: 450;
  letter-spacing: -.00666667em;
  color: lch(20% 1 282 / 1);
}

.threadReplyInput :global(.ProseMirror p.is-empty) {
  padding-bottom: 0;
}

.threadReplyInput :global(.ProseMirror p:only-of-type),
.threadReplyInput :global(.ProseMirror p:last-child) {
  margin-bottom: 0 !important;
}

[data-theme="dark"] .chatInput :global(.ProseMirror p),
 [data-theme="dark"] .threadReplyInput :global(.ProseMirror p),
 [data-theme="dark"] .messageEditInput :global(.ProseMirror p) {
color: #e5e7eb;
}

.chatInput :global(.ProseMirror ul),
.chatInput :global(.ProseMirror ol),
.threadReplyInput :global(.ProseMirror ul),
.threadReplyInput :global(.ProseMirror ol),
.messageEditInput :global(.ProseMirror ul),
.messageEditInput :global(.ProseMirror ol) {
  margin: 0.25em 0;
  padding-left: 1.4em;
}

/* Placeholder shown while empty */
.chatInput :global(.ProseMirror p.is-editor-empty:first-child::before),
.threadReplyInput :global(.ProseMirror p.is-editor-empty:first-child::before),
.messageEditInput :global(.ProseMirror p.is-editor-empty:first-child::before) {
  content: attr(data-placeholder);
  color: #595959;
  float: left;
  height: 0;
  pointer-events: none;
  font-weight: 450;
  letter-spacing: -.00666667em;
}
[data-theme="dark"] .chatInput :global(.ProseMirror p.is-editor-empty:first-child::before),
[data-theme="dark"] .threadReplyInput :global(.ProseMirror p.is-editor-empty:first-child::before),
[data-theme="dark"] .messageEditInput :global(.ProseMirror p.is-editor-empty:first-child::before) {
  color: #969696;
}

/* "Leave a reply…" placeholder uses a lighter grey */
.threadReplyInput :global(.ProseMirror p.is-editor-empty:first-child::before) {
  color: #a3a3a3;
}

/* Rendered rich-text comment content (read view) */
.messageRichText p {
  margin: 0 0 0.4em;
  background: transparent;
  border: none;
  border-radius: 0;
  color: lch(20% 1 282/1);
  font-family: Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif,emoji;
  font-size: 14px;
  font-weight: 450;
  letter-spacing: -.00666667em;
  line-height: 1.6;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
[data-theme="dark"] .messageRichText p,
[data-theme="dark"] .messageRichText ol,
[data-theme="dark"] .messageRichText ul {
  color: #e3e4e7;
}

.messageRichText p:last-child {
  margin-bottom: 0;
}
.messageRichText ul,
.messageRichText ol {
  margin: 0.3em 0;
  padding-left: 1.4em;
}
.messageRichText img.commentImage {
  max-width: 100%;
  border-radius: 8px;
  margin: 4px 0;
  display: block;
}

/* Inline formatting marks inside the comment editors and rendered comment HTML.
   A global `strong { font-weight }` rule doesn't reliably win against the
   editor's 450 base, so style the marks explicitly (mirrors the description
   editor). */
.chatInput :global(.ProseMirror strong),
.threadReplyInput :global(.ProseMirror strong),
.messageEditInput :global(.ProseMirror strong),
.messageRichText strong,
.messageRichText b {
  font-weight: 600;
}
.chatInput :global(.ProseMirror em),
.threadReplyInput :global(.ProseMirror em),
.messageEditInput :global(.ProseMirror em),
.messageRichText em,
.messageRichText i {
  font-style: italic;
}
.chatInput :global(.ProseMirror u),
.threadReplyInput :global(.ProseMirror u),
.messageEditInput :global(.ProseMirror u),
.messageRichText u {
  text-decoration: underline;
}
.chatInput :global(.ProseMirror s),
.threadReplyInput :global(.ProseMirror s),
.messageEditInput :global(.ProseMirror s),
.messageRichText s,
.messageRichText strike {
  text-decoration: line-through;
}

/* Inline code inside comment editors and rendered comment HTML */
.chatInput :global(.ProseMirror code),
.threadReplyInput :global(.ProseMirror code),
.messageEditInput :global(.ProseMirror code),
.messageRichText code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.875em;
  background-color: #fafafa;
  color: #b91c1c;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #e7e7e7;
}
[data-theme="dark"] .chatInput :global(.ProseMirror code),
[data-theme="dark"] .threadReplyInput :global(.ProseMirror code),
[data-theme="dark"] .messageEditInput :global(.ProseMirror code),
[data-theme="dark"] .messageRichText code {
  background: #2a2a2a;
  color: #fca5a5;
  border-color: #3a3a3a;
}

/* Code blocks (pre) inside comment editors and rendered comment HTML */
.chatInput :global(.ProseMirror pre),
.threadReplyInput :global(.ProseMirror pre),
.messageEditInput :global(.ProseMirror pre),
.messageRichText pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 0.875em;
  background-color: #fafafa;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  overflow: auto;
  white-space: pre;
}

/* Inner code of a block has no own box (avoids per-line backgrounds) */
.chatInput :global(.ProseMirror pre code),
.threadReplyInput :global(.ProseMirror pre code),
.messageEditInput :global(.ProseMirror pre code),
.messageRichText pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

[data-theme="dark"] .chatInput :global(.ProseMirror pre),
[data-theme="dark"] .threadReplyInput :global(.ProseMirror pre),
[data-theme="dark"] .messageEditInput :global(.ProseMirror pre),
[data-theme="dark"] .messageRichText pre {
  background-color: #2a2a2a;
  border-color: #3a3a3a;
}

/* Cursor agent status block (heading + branch + status) */
.messageRichText :global(.cursorStatusBox) {
  background-color: #fafafa;
  border: 1px solid #e7e7e7;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 6px 0 16px 0;
}

.messageRichText :global(.cursorStatusBox) p {
  margin: 0;
}

.messageRichText :global(.cursorStatusBox) p + p {
  margin-top: 4px;
}

[data-theme="dark"] .messageRichText :global(.cursorStatusBox) {
  background-color: #2a2a2a;
  border-color: #3a3a3a;
}

.agentBadge {
  background: #ffffff;
  color: #374151;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  line-height: 14px;
}

.agentCollapseToggle {
  margin-left: auto;
  border: none;
  background: transparent;
  color: lch(40% 1 282 / 1);
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}

[data-theme="dark"] .agentCollapseToggle {
  color: #cbd5e1;
}

.agentCollapseToggle:hover {
  color: #111827;
}

[data-theme="dark"] .agentCollapseToggle:hover {
  color: #f1f5f9;
}

[data-theme="dark"] .agentBadge {
  background: #1f1f1f;
  color: #cbd5e1;
  border-color: #3a3a3a;
}

.claireThinking {
  display: flex;
  align-items: center;
  gap: 8px;
}
.claireThinkingLabel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.claireThinkingText {
  font-size: 13px;
  font-weight: 450;
  background: linear-gradient(
    90deg,
    rgba(107, 114, 128, 0.5) 0%,
    rgba(107, 114, 128, 0.5) 35%,
    #111827 50%,
    rgba(107, 114, 128, 0.5) 65%,
    rgba(107, 114, 128, 0.5) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: claireShimmer 1.6s linear infinite;
}
[data-theme="dark"] .claireThinkingText {
  background: linear-gradient(
    90deg,
    rgba(150, 150, 150, 0.55) 0%,
    rgba(150, 150, 150, 0.55) 35%,
    #969696 50%,
    rgba(150, 150, 150, 0.55) 65%,
    rgba(150, 150, 150, 0.55) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
@keyframes claireShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .claireThinkingText {
    animation: none;
  }
}
