.message-composer { border: 1px solid #cbd5e1; border-radius: 0.75rem; background: white; overflow: hidden; min-width: 0; }
.message-composer:focus-within { border-color: #4f46e5; box-shadow: 0 0 0 3px #6366f11a; }
.rich-editor { position: relative; min-height: 150px; max-height: 360px; overflow-y: auto; padding: 0.875rem; outline: none; font-size: 0.875rem; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.rich-editor[data-empty="true"]::before { content: attr(data-placeholder); color: #94a3b8; pointer-events: none; position: absolute; inset: 0.875rem; white-space: normal; }
.rich-editor.is-dragging { background: #eef2ff; }
.rich-editor[data-busy="true"] { cursor: progress; }
.composer-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.625rem 0.75rem; border-top: 1px solid #e2e8f0; background: #f8fafc; }
.composer-attach { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; border-radius: 0.5rem; padding: 0.375rem 0.625rem; color: #4338ca; font-size: 0.75rem; font-weight: 600; }
.composer-attach:hover { background: #eef2ff; }
.composer-help, .composer-status { color: #64748b; font-size: 0.6875rem; }
.composer-status { margin-left: auto; }
.media-attachment { position: relative; display: block; width: fit-content; max-width: 100%; margin: 0.75rem 0; padding: 0.625rem; border: 1px solid #e2e8f0; border-radius: 0.75rem; background: #fff; white-space: normal; }
.media-attachment img, .media-attachment video { display: block; max-width: 100%; max-height: 320px; width: auto; height: auto; border-radius: 0.375rem; object-fit: contain; }
.media-attachment audio { display: block; max-width: 100%; width: 300px; }
.media-attachment figcaption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.5rem; color: #64748b; font-size: 0.6875rem; overflow-wrap: anywhere; }
.media-attachment a { color: #4f46e5; text-decoration: underline; text-underline-offset: 2px; }
.media-filename { flex: 1 1 8rem; min-width: 0; }
.media-fallback { margin-top: 0.5rem; color: #64748b; font-size: 0.75rem; }
.media-remove { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #e2e8f0; background: white; color: #475569; }
.message-content { min-width: 0; overflow-wrap: anywhere; }
.message-content p { white-space: pre-wrap; }
.message-content > * + * { margin-top: 0.5rem; }
.conversation-scroll { max-height: 50vh; overflow-y: auto; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }
.comment-actions > label { min-width: 0; }
#ticketDetailBody[data-requester="true"] { grid-template-columns: minmax(0, 1fr); }
#ticketDetailBody[data-requester="true"] > div { grid-column: auto; }
#ticketDetailBody[data-requester="true"] > div:last-child:not(:has(#csatBox:not(.hidden))) { display: none; }
button:disabled { opacity: 0.55; cursor: wait; }
.ticket-autosave-status { font-size: 0.6875rem; line-height: 1.5; color: #64748b; }
.ticket-field-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; min-height: 1rem; margin-top: 0.25rem; font-size: 0.6875rem; line-height: 1.5; color: #64748b; }
.ticket-field-feedback[data-state="saved"] { color: #15803d; }
.ticket-field-feedback[data-state="pending"] { color: #4f46e5; }
.ticket-field-feedback[data-state="error"], .ticket-autosave-status[data-state="error"] { color: #b91c1c; }
.ticket-save-retry { padding: 0.125rem 0.25rem; color: #4338ca; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ticket-save-retry[hidden] { display: none; }
#agentControls select[aria-invalid="true"] { border-color: #f87171; }
@media (max-width: 767px) {
  .rich-editor { font-size: 16px; min-height: 140px; max-height: 280px; }
  .composer-toolbar { padding: 0.5rem; }
  .composer-status { width: 100%; margin-left: 0; }
  .media-remove { min-width: 36px !important; min-height: 36px; }
  .media-attachment { width: 100%; }
  .media-attachment audio { width: 100%; }
  .media-attachment img, .media-attachment video { max-height: 240px; }
  .conversation-scroll { max-height: 45vh; }
}
