/* MIRAD chat: compact message rhythm, retaining existing theme tokens. */
.mirad-v2-chat-thread div[class*="overflow-y-auto"][class*="space-y-2"]:has(> [id^="msg-anchor-"]) {
  padding: 12px 16px;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] { margin-top: 5px !important; }
.mirad-v2-chat-thread [id^="msg-anchor-"] > div { margin-bottom: 2px; }
.mirad-v2-chat-thread [id^="msg-anchor-"] > .group > div:first-child {
  gap: 6px; margin-bottom: 3px; min-width: 0; flex-wrap: wrap;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] > .group > div:first-child > span[class*="text-[10px]"] {
  display: none;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] > .group > div[class*="max-w-[88%]"] {
  width: fit-content; min-width: 0; max-width: min(86%, 34rem);
  padding: 7px 11px 6px; border-radius: 13px;
  overflow-wrap: anywhere;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] > .group > div[class*="max-w-[88%]"] > p {
  line-height: 1.4; margin: 0;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="border-l-2"] {
  padding: 5px 8px; margin-bottom: 5px;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="mt-3"][class*="border-t"] {
  margin-top: 6px; padding-top: 5px;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="mt-3"][class*="border-t"] > * + * { margin-top: 5px; }
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="group/img"],
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="group/vid"] {
  width: min(100%, 19rem); max-width: 100%; border-radius: 10px;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="group/img"] > img {
  max-height: 13rem; width: 100%; object-fit: contain;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="group/img"] > [role="status"] {
  min-height: 92px !important; min-width: 0 !important; padding: 10px;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="group/img"] > div:last-child:not([role="status"]),
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="group/vid"] > div:last-child {
  padding: 4px 7px; gap: 5px; min-width: 0;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="group/img"] > div:last-child > span:first-child,
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="group/vid"] > div:last-child > span:first-child {
  min-width: 0; flex: 1;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="group/img"] > div:last-child > span:last-child { flex-shrink: 0; }
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="group/vid"] > div:first-child { height: 8.5rem; }
.mirad-v2-chat-thread [id^="msg-anchor-"] a[class*="group/file"] {
  width: min(100%, 22rem); max-width: 100%; box-sizing: border-box;
  gap: 8px; padding: 6px 8px; border-radius: 10px;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] a[class*="group/file"] > div:first-child { flex: 1; min-width: 0; gap: 7px; }
.mirad-v2-chat-thread [id^="msg-anchor-"] a[class*="group/file"] > div:first-child > div:first-child { padding: 5px; }
.mirad-v2-chat-thread [id^="msg-anchor-"] a[class*="group/file"] > div:first-child > div:last-child { flex: 1; min-width: 0; }
.mirad-v2-chat-thread [id^="msg-anchor-"] a[class*="group/file"] > div:last-child { flex-shrink: 0; padding: 4px; }
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="justify-end"][class*="mt-2"][class*="pt-1.5"] {
  margin-top: 2px; padding-top: 0; gap: 4px; line-height: 1.2;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="mt-2.5"][class*="border-t"] {
  margin-top: 5px; padding-top: 4px; gap: 4px;
}
.mirad-v2-chat-thread [id^="msg-anchor-"] div[class*="mt-2.5"][class*="border-t"] > button {
  padding: 1px 6px; gap: 3px;
}
@media (max-width: 640px) {
  .mirad-v2-chat-thread div[class*="overflow-y-auto"][class*="space-y-2"]:has(> [id^="msg-anchor-"]) { padding: 8px 10px; }
  .mirad-v2-chat-thread [id^="msg-anchor-"] > .group > div[class*="max-w-[88%]"] { max-width: 92%; }
}
