/* ClientDialogue Package Styles */

.clientdialogue-chat-shell {
    border-collapse: separate;
    border-spacing: 0;
    display: flex;
    height: 100%;
    max-width: none;
    min-height: 0;
    overflow: hidden;
    table-layout: fixed;
    width: 100%;
}

.clientdialogue-chat-frame {
    height: min(46rem, calc(100vh - 12rem));
    max-height: calc(100vh - 12rem);
}

.clientdialogue-chat-shell > tbody,
.clientdialogue-chat-shell > tbody > tr {
    display: flex;
    min-height: 0;
    height: 100%;
    width: 100%;
}

.clientdialogue-chat-sidebar-cell {
    display: block;
    flex: 0 0 26.5rem;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    transition: flex-basis 220ms ease, width 220ms ease, max-width 220ms ease, opacity 180ms ease;
    vertical-align: top;
    width: 26.5rem;
}

.clientdialogue-chat-sidebar-cell.is-collapsed {
    min-width: 0 !important;
}

.clientdialogue-chat-main-cell {
    display: block;
    flex: 1 1 0%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    transition: width 220ms ease;
    vertical-align: top;
}

.clientdialogue-chat-sidebar {
    height: 100%;
    max-height: none;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    transition: opacity 180ms ease, transform 220ms ease;
    width: 100%;
}

.clientdialogue-chat-sidebar-cell.is-collapsed .clientdialogue-chat-sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-0.75rem);
}

.clientdialogue-chat-main {
    background: #f6f6f6;
    display: flex;
    flex: 1 1 0%;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.dialogue-message-list {
    max-width: 58rem;
}

.dialogue-message-bubble {
    --dialogue-bubble-quote-bg: #e9ecef;
    --dialogue-bubble-quote-border: #cbd5e1;
    max-width: min(34rem, 78%);
    position: relative;
    overflow: visible;
    width: fit-content;
}

@media (max-width: 640px) {
    .dialogue-message-bubble {
        max-width: 86%;
    }
}

.dialogue-message-bubble--received {
    --dialogue-bubble-quote-bg: #e9ecef;
    --dialogue-bubble-quote-border: #cbd5e1;
    border-bottom-left-radius: 0.35rem !important;
}

.dialogue-message-bubble--right {
    --dialogue-bubble-quote-bg: #e9ecef;
    --dialogue-bubble-quote-border: #cbd5e1;
    border-bottom-right-radius: 0.35rem !important;
}

.dialogue-message-bubble--own {
    --dialogue-bubble-quote-bg: rgb(var(--primary-200, 153 246 228));
    --dialogue-bubble-quote-border: rgb(var(--primary-400, 45 212 191) / 0.76);
    border-bottom-right-radius: 0.35rem !important;
}

.dialogue-composer-shell {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 1.1rem;
    background: #ffffff;
    box-shadow: 0 0.875rem 2rem rgb(17 24 39 / 0.12);
}

.dialogue-composer-row {
    display: block;
}

.dialogue-message-input-shell {
    background: transparent !important;
    bottom: 0;
    left: 0;
    pointer-events: none;
    position: absolute !important;
    right: 0;
    z-index: 1;
}

.dialogue-message-input-shell .dialogue-message-list {
    pointer-events: auto;
}

.dialogue-composer-shell,
.dialogue-composer-shell * {
    pointer-events: auto;
}

#messages-container {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 8rem;
}

.dialogue-composer-layout {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) 3.25rem;
    width: 100%;
    align-items: stretch;
}

.dialogue-composer-main {
    min-width: 0;
}

.dialogue-composer-reply {
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 0.75rem 0.875rem;
}

.dialogue-composer-shell:focus-within {
    border-color: #d1d5db;
    box-shadow: 0 0 0 1px #d1d5db, 0 0.875rem 2rem rgb(17 24 39 / 0.12);
    outline: none;
}

.dialogue-composer-shell--dragover {
    border-color: rgb(var(--primary-500, 16 72 80) / 0.55);
    background: rgb(var(--primary-50, 240 253 250));
}

.dialogue-composer-action {
    display: inline-flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.dialogue-composer-attach {
    border-right: 1px solid #e5e7eb;
    border-radius: 0;
    background: rgb(var(--primary-50, 240 253 250) / 0.65);
    color: rgb(var(--primary-700, 15 118 110));
}

.dialogue-composer-send {
    border-left: 1px solid #e5e7eb;
    border-radius: 0;
    background: rgb(var(--primary-600, 13 148 136));
    color: #ffffff;
}

.dialogue-composer-attach:hover,
.dialogue-composer-attach:focus-visible {
    background: rgb(var(--primary-50, 240 253 250));
    color: rgb(var(--primary-900, 19 78 74));
    outline: none;
}

.dialogue-composer-send:hover,
.dialogue-composer-send:focus-visible {
    background: rgb(var(--primary-700, 15 118 110));
    outline: none;
}

.dialogue-composer-input {
    min-width: 0;
}

.dialogue-composer-input .fi-fo-field-wrp,
.dialogue-composer-input .fi-fo-field-wrp > *,
.dialogue-composer-input .fi-fo-field-wrp > div,
.dialogue-composer-input .fi-input-wrp,
.dialogue-composer-input .fi-rich-editor,
.dialogue-composer-input .fi-rich-editor-editor,
.dialogue-composer-input .fi-rich-editor-content,
.dialogue-composer-input .fi-fo-rich-editor,
.dialogue-composer-input .fi-fo-rich-editor-toolbar,
.dialogue-composer-input .fi-fo-rich-editor-editor,
.dialogue-composer-input trix-toolbar,
.dialogue-composer-input trix-editor {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    --tw-ring-color: transparent !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-shadow: 0 0 #0000 !important;
}

.dialogue-composer-input .fi-fo-rich-editor {
    display: flex !important;
    flex-direction: column !important;
}

.dialogue-composer-input .fi-fo-rich-editor-toolbar {
    border-bottom: 1px solid #e5e7eb !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.dialogue-composer-input trix-toolbar {
    overflow: visible !important;
}

.dialogue-composer-input trix-toolbar .trix-dialogs {
    position: static !important;
    display: block !important;
    width: 100% !important;
}

.dialogue-composer-input trix-toolbar .trix-dialog {
    position: static !important;
    inset: auto !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0.55rem 0 !important;
    border: 0 !important;
    border-top: 1px solid #e5e7eb !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    transform: none !important;
}

.dialogue-composer-input trix-toolbar .trix-dialog:not([data-trix-active]) {
    display: none !important;
}

.dialogue-composer-input trix-toolbar .trix-dialog__link-fields {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.dialogue-composer-input trix-toolbar .trix-input--dialog {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 2.25rem !important;
    padding: 0.4rem 0.625rem !important;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 0.8125rem !important;
    line-height: 1.25rem !important;
    box-shadow: none !important;
    outline: none !important;
}

.dialogue-composer-input trix-toolbar .trix-input--dialog:focus {
    border-color: #9ca3af !important;
    box-shadow: 0 0 0 1px #9ca3af !important;
}

.dialogue-composer-input trix-toolbar .trix-button-group--dialog,
.dialogue-composer-input trix-toolbar .trix-dialog__link-fields .trix-button-group {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    gap: 0.375rem !important;
    margin: 0 !important;
    border: 0 !important;
}

.dialogue-composer-input trix-toolbar .trix-button--dialog {
    min-height: 2.25rem !important;
    padding: 0.375rem 0.7rem !important;
    border: 1px solid rgb(var(--primary-600, 13 148 136)) !important;
    border-radius: 0.5rem !important;
    background: rgb(var(--primary-600, 13 148 136)) !important;
    color: #ffffff !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    line-height: 1.25rem !important;
    text-indent: 0 !important;
}

.dialogue-composer-input trix-toolbar .trix-button--dialog:hover,
.dialogue-composer-input trix-toolbar .trix-button--dialog:focus-visible {
    background: rgb(var(--primary-700, 15 118 110)) !important;
    outline: none !important;
}

.dialogue-composer-input trix-toolbar .trix-button--dialog[data-trix-method="removeAttribute"] {
    border-color: #e5e7eb !important;
    background: #ffffff !important;
    color: #4b5563 !important;
}

.dialogue-composer-input trix-toolbar .trix-button--dialog[data-trix-method="removeAttribute"]:hover,
.dialogue-composer-input trix-toolbar .trix-button--dialog[data-trix-method="removeAttribute"]:focus-visible {
    border-color: #d1d5db !important;
    background: #f9fafb !important;
    color: #111827 !important;
}

@media (max-width: 520px) {
    .dialogue-composer-input trix-toolbar .trix-dialog__link-fields {
        grid-template-columns: 1fr !important;
    }

    .dialogue-composer-input trix-toolbar .trix-button-group--dialog,
    .dialogue-composer-input trix-toolbar .trix-dialog__link-fields .trix-button-group {
        justify-content: flex-end !important;
    }
}

.dialogue-composer-input trix-editor,
.dialogue-composer-input .fi-fo-rich-editor-editor {
    display: block !important;
    min-height: 2.75rem !important;
    height: auto !important;
    max-height: min(15rem, 42vh) !important;
    overflow-y: auto;
    padding: 0.65rem 0.875rem !important;
}

.dialogue-composer-input .fi-fo-rich-editor:focus-within,
.dialogue-composer-input .fi-fo-rich-editor-editor:focus,
.dialogue-composer-input trix-editor:focus,
.dialogue-composer-input trix-editor:focus-visible {
    border: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    --tw-ring-color: transparent !important;
    --tw-ring-shadow: 0 0 #0000 !important;
}

.dialogue-composer-input .fi-fo-field-wrp-error-message,
.dialogue-composer-input .fi-fo-field-wrp-helper-text,
.dialogue-composer-input .fi-fo-field-wrp-label {
    display: none;
}

.dialogue-composer-input [contenteditable],
.dialogue-composer-input textarea {
    min-height: 2.75rem;
    height: auto;
    max-height: min(15rem, 42vh);
    padding: 0.65rem 0.875rem;
    background: transparent;
    outline: none;
}

.dialogue-composer-shell--compact .dialogue-composer-input trix-editor,
.dialogue-composer-shell--compact .dialogue-composer-input .fi-fo-rich-editor-editor {
    min-height: 2.75rem !important;
    height: auto !important;
    max-height: min(15rem, 42vh) !important;
    padding: 0.65rem 0.875rem !important;
}

.dialogue-composer-shell--compact .dialogue-composer-input [contenteditable],
.dialogue-composer-shell--compact .dialogue-composer-input textarea {
    min-height: 2.75rem;
    height: auto;
    max-height: min(15rem, 42vh);
    padding: 0.65rem 0.875rem;
}

.dialogue-composer-uploads {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.dialogue-composer-upload-card {
    display: flex;
    min-width: 0;
    max-width: min(100%, 22rem);
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.45rem;
    border: 1px solid rgb(var(--primary-200, 153 246 228));
    border-radius: 0.75rem;
    background: #ffffff;
    color: #374151;
    font-size: 0.75rem;
}

.dialogue-composer-upload-preview,
.dialogue-message-attachment__preview {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid rgb(var(--primary-200, 153 246 228));
    border-radius: 0.55rem;
    background: rgb(var(--primary-50, 240 253 250));
    color: rgb(var(--primary-800, 17 94 89));
    font-size: 0.675rem;
    font-weight: 700;
    letter-spacing: 0;
}

.dialogue-composer-upload-preview {
    width: 2.25rem;
    height: 2.25rem;
}

.dialogue-composer-upload-preview img,
.dialogue-message-attachment__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dialogue-composer-upload-meta,
.dialogue-message-attachment__meta {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.05rem;
}

.dialogue-composer-upload-name,
.dialogue-message-attachment__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dialogue-composer-upload-name {
    font-weight: 600;
}

.dialogue-message-attachment__name {
    display: block;
    max-width: 100%;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
}

.dialogue-composer-upload-size,
.dialogue-message-attachment__size {
    color: #6b7280;
    font-size: 0.6875rem;
    line-height: 1rem;
}

.dialogue-composer-drop-overlay {
    border: 2px dashed rgb(var(--primary-500, 16 72 80) / 0.65);
    border-radius: 1.1rem;
    background: rgb(var(--primary-50, 240 253 250) / 0.92);
    color: rgb(var(--primary-700, 15 118 110));
}

.dialogue-message-search-input-wrap {
    position: relative;
    width: 100%;
    border: 1px solid #d1d5db !important;
    border-radius: 0.5rem;
    background: #ffffff;
    box-shadow: none;
    transition: none;
}

.dialogue-message-search-input-wrap:focus-within {
    border-color: #d1d5db !important;
    box-shadow: none !important;
    outline: none !important;
}

.dialogue-message-search-input {
    appearance: none;
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 2.5rem;
    padding: 0.55rem 0.85rem;
    border: 0 !important;
    border-radius: 0.5rem !important;
    background-color: #ffffff !important;
    color: #111827 !important;
    font-size: 0.8125rem !important;
    box-shadow: none !important;
    outline: none !important;
    line-height: 1.25rem !important;
}

.dialogue-message-search-input:focus {
    outline: none;
    background-color: #ffffff !important;
    box-shadow: none !important;
}

.dialogue-message-search-input::placeholder {
    color: #9ca3af !important;
    font-size: 0.8125rem !important;
}

.dialogue-message-search-results {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background-color: transparent;
}

.dialogue-message-search-result {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    text-align: left;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.dialogue-message-search-result:hover,
.dialogue-message-search-result:focus-visible,
.dialogue-message-search-result.is-active {
    background: rgb(var(--primary-50, 240 253 250));
    outline: none;
}

.dialogue-message-search-scope {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 0.85rem;
}

.dialogue-message-search-scope-option {
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    color: #4b5563;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25rem;
    text-align: center;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.dialogue-message-search-scope-option + .dialogue-message-search-scope-option {
    border-left: 0;
}

.dialogue-message-search-scope-option:hover,
.dialogue-message-search-scope-option:focus-visible,
.dialogue-message-search-scope-option.is-active {
    border-bottom-color: rgb(var(--primary-600, 13 148 136));
    background: transparent;
    color: rgb(var(--primary-800, 17 94 89));
    outline: none;
}

.dialogue-message-search-close {
    display: inline-flex;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #6b7280;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.dialogue-message-search-close:hover,
.dialogue-message-search-close:focus-visible {
    background: #f3f4f6;
    color: #111827;
    outline: none;
}

.dialogue-topic-status-pill {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    border: 1px solid rgb(107 114 128 / 0.22);
    border-radius: 9999px;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1rem;
}

.dialogue-topic-status-pill--pending {
    border-color: rgb(107 114 128 / 0.22);
    background: #f9fafb;
    color: #4b5563;
}

.dialogue-topic-status-pill--in-progress {
    border-color: rgb(202 138 4 / 0.28);
    background: #fefce8;
    color: #854d0e;
}

.dialogue-topic-status-pill--on-hold {
    border-color: rgb(147 51 234 / 0.42);
    background: #ede9fe;
    color: #6b21a8;
}

.dialogue-topic-status-pill--completed {
    border-color: rgb(22 163 74 / 0.24);
    background: #f0fdf4;
    color: #15803d;
}

.dialogue-topic-responsibility-pill {
    display: inline-flex;
    min-width: 0;
    max-width: min(100%, 18rem);
    align-items: center;
    flex-shrink: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    border: 1px solid #bfdbfe;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1d4ed8;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1rem;
}

.dialogue-topic-responsibility-pill--header {
    max-width: min(22rem, 52vw);
    flex: 0 1 auto;
    font-size: 0.75rem;
}

.dialogue-message-content ul {
    list-style-type: disc;
    padding-left: 20px;
}

.dialogue-message-content ol {
    list-style-type: decimal;
    padding-left: 20px;
}

.dialogue-message-content :where(p, ul, ol, blockquote) {
    margin-bottom: 0.5rem !important;
    margin-top: 0.5rem !important;
}

.dialogue-message-content :where(p, li, div) {
    line-height: 1.46 !important;
}

.dialogue-message-content > :first-child {
    margin-top: 0 !important;
}

.dialogue-message-content > :last-child {
    margin-bottom: 0 !important;
}

.dialogue-message-content p:empty {
    display: none;
}

::highlight(dialogue-quote-highlight) {
    background: rgb(180 154 103 / 0.45);
    color: inherit;
}

.dialogue-quote-text-highlight {
    background: rgb(180 154 103 / 0.45);
    border-radius: 0.1875rem;
    box-shadow: 0 0 0 2px rgb(180 154 103 / 0.18);
}

.dialogue-bubble-quote {
    width: 100%;
    margin-bottom: 0.625rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 0.65rem;
    background: var(--dialogue-bubble-quote-bg);
    box-shadow: none;
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1.35;
    text-align: left;
    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.dialogue-bubble-quote:hover,
.dialogue-bubble-quote:focus,
.dialogue-bubble-quote:focus-visible {
    border-color: var(--dialogue-bubble-quote-border) !important;
    background: var(--dialogue-bubble-quote-bg) !important;
    box-shadow: inset 0 0 0 1px var(--dialogue-bubble-quote-border) !important;
    outline: none;
}

.dialogue-bubble-quote--own {
    color: rgb(var(--primary-950, 4 47 46));
}

.dialogue-bubble-quote--received {
    color: #374151;
}

.dialogue-bubble-quote__header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    line-height: 1.15;
}

.dialogue-bubble-quote__text {
    margin-top: 0.0625rem;
    line-height: 1.42;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.dialogue-bubble-quote__text.is-clamped {
    max-height: calc(1.42em * 5);
    overflow: hidden;
}

.dialogue-bubble-quote__text.is-expanded {
    max-height: none;
    overflow: visible;
}

.dialogue-bubble-quote__toggle {
    margin-top: 0.375rem;
    margin-left: -0.25rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.375rem;
    color: rgb(var(--primary-700, 15 118 110));
    font-size: 0.75rem;
    font-weight: 600;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.dialogue-bubble-quote__toggle:hover,
.dialogue-bubble-quote__toggle:focus-visible {
    background: rgb(var(--primary-50, 240 253 250));
    color: rgb(var(--primary-900, 19 78 74));
    outline: none;
}

.dialogue-reply-preview-content {
    line-height: 1.46;
    white-space: pre-line;
}

.dialogue-reply-preview-content.is-clamped {
    max-height: calc(1.46em * 2);
    overflow: hidden;
}

.dialogue-reply-preview-content.is-expanded {
    max-height: none;
    overflow: visible;
}

.dialogue-reply-preview-content :where(p, div, ul, ol, blockquote) {
    margin-bottom: 0.42rem !important;
    margin-top: 0.42rem !important;
}

.dialogue-reply-preview-content :where(p, li, div),
.dialogue-reply-preview-content br {
    line-height: 1.46 !important;
}

.dialogue-composer-input trix-editor :where(p, div, ul, ol, blockquote) {
    margin-bottom: 0.5rem !important;
    margin-top: 0.5rem !important;
}

.dialogue-composer-input trix-editor :where(p, li, div) {
    line-height: 1.46 !important;
}

.dialogue-message-marker--red {
    --dialogue-bubble-quote-bg: #fecaca;
    --dialogue-bubble-quote-border: #f87171;
    border-color: #fca5a5 !important;
    background: #fee2e2 !important;
}

.dialogue-message-marker--yellow,
.dialogue-message-marker--orange {
    --dialogue-bubble-quote-bg: #fef08a;
    --dialogue-bubble-quote-border: #eab308;
    border-color: #fde047 !important;
    background: #fef9c3 !important;
}

.dialogue-message-marker--green {
    --dialogue-bubble-quote-bg: #bbf7d0;
    --dialogue-bubble-quote-border: #22c55e;
    border-color: #86efac !important;
    background: #dcfce7 !important;
}

.dialogue-message-marker--purple {
    --dialogue-bubble-quote-bg: #e9d5ff;
    --dialogue-bubble-quote-border: #c084fc;
    border-color: #d8b4fe !important;
    background: #f3e8ff !important;
}

.dialogue-message-marker--blue {
    --dialogue-bubble-quote-bg: #bfdbfe;
    --dialogue-bubble-quote-border: #60a5fa;
    border-color: #93c5fd !important;
    background: #dbeafe !important;
}

.dialogue-message-marker--brown {
    --dialogue-bubble-quote-bg: #e7cfb6;
    --dialogue-bubble-quote-border: #bd9364;
    border-color: #d6b48c !important;
    background: #f1e4d1 !important;
}

.dialogue-marker-palette {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 0.75rem 1.5rem rgb(17 24 39 / 0.14);
}

.dialogue-message-complete-action {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    color: #6b7280;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.dialogue-message-complete-action:hover,
.dialogue-message-complete-action:focus-visible {
    background: #ffffff;
    color: rgb(var(--primary-700, 15 118 110));
    outline: none;
}

.dialogue-message-complete-action.is-active {
    color: #6b7280;
}

.dialogue-message-completed-state {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 8rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    background: rgb(187 247 208 / 0.72);
    box-shadow: 0 0 0 1px rgb(34 197 94 / 0.18);
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25rem;
}

.dialogue-message-attachments {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.625rem;
}

.dialogue-message-attachment {
    display: flex;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.5rem;
    border: 1px solid rgb(var(--primary-200, 153 246 228));
    border-radius: 0.75rem;
    background: rgb(var(--primary-50, 240 253 250) / 0.72);
    color: rgb(var(--primary-800, 17 94 89));
    font-size: 0.75rem;
    line-height: 1rem;
    text-align: left;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.dialogue-message-attachment:hover,
.dialogue-message-attachment:focus-visible {
    border-color: rgb(var(--primary-300, 94 234 212));
    background: rgb(var(--primary-50, 240 253 250));
    color: rgb(var(--primary-900, 19 78 74));
    outline: none;
}

.dialogue-message-attachment__preview {
    width: 2.5rem;
    height: 2.5rem;
}

.dialogue-marker-swatch {
    display: inline-flex;
    width: 1.35rem;
    height: 1.35rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.dialogue-marker-swatch:hover,
.dialogue-marker-swatch:focus-visible,
.dialogue-marker-swatch.is-selected {
    background: #f3f4f6;
    box-shadow: 0 0 0 2px rgb(var(--primary-500, 20 184 166) / 0.22);
    outline: none;
}

.dialogue-marker-dot {
    position: relative;
    width: 0.625rem;
    height: 0.625rem;
    flex: 0 0 auto;
    border: 1px solid rgb(17 24 39 / 0.12);
    border-radius: 9999px;
}

.dialogue-marker-dot--red {
    background: #ef4444;
}

.dialogue-marker-dot--yellow,
.dialogue-marker-dot--orange {
    background: #eab308;
}

.dialogue-marker-dot--green {
    background: #22c55e;
}

.dialogue-marker-dot--purple {
    background: #8b5cf6;
}

.dialogue-marker-dot--blue {
    background: #2563eb;
}

.dialogue-marker-dot--brown {
    background: #8b5e34;
}

.dialogue-marker-dot--none {
    background: #ffffff;
}

.dialogue-marker-dot--none::after {
    position: absolute;
    top: 50%;
    left: -0.125rem;
    width: 0.875rem;
    height: 1px;
    background: #6b7280;
    content: "";
    transform: rotate(-45deg);
    transform-origin: center;
}

.dialogue-message-search-results,
.dialogue-sidebar-list-panel {
    position: relative;
}

.dialogue-message-search-results::after,
.dialogue-sidebar-list-panel::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2.25rem;
    pointer-events: none;
    background: linear-gradient(to bottom, rgb(255 255 255 / 0), #ffffff);
    content: "";
    opacity: 0;
    transition: opacity 160ms ease;
}

.dialogue-message-search-results.has-more-below::after,
.dialogue-sidebar-list-panel.has-more-below::after {
    opacity: 1;
}

.dialogue-quote-selection-popover {
    position: fixed;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    background: transparent;
    filter: drop-shadow(0 10px 18px rgb(15 23 42 / 0.18));
}

.dialogue-quote-selection-popover__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25rem;
    padding: 0.375rem 0.75rem;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.dialogue-quote-selection-popover__button--quote,
.dialogue-quote-selection-popover__button--complete {
    border-color: rgb(var(--primary-700, 15 118 110));
    background: rgb(var(--primary-600, 13 148 136));
    color: #ffffff;
}

.dialogue-quote-selection-popover__button--quote:hover,
.dialogue-quote-selection-popover__button--quote:focus-visible,
.dialogue-quote-selection-popover__button--complete:hover,
.dialogue-quote-selection-popover__button--complete:focus-visible {
    background: rgb(var(--primary-700, 15 118 110));
    outline: none;
}

.dialogue-quote-selection-popover[hidden] {
    display: none;
}

.dialogue-selection-completed {
    border-radius: 0.1875rem;
    background: rgb(187 247 208 / 0.72);
    box-shadow: 0 0 0 1px rgb(34 197 94 / 0.18);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    padding: 0.015rem 0.125rem;
}

.dialogue-selection-completed__badge {
    display: inline-flex;
    width: 1rem;
    height: 1rem;
    align-items: center;
    justify-content: center;
    margin-left: 0.2rem;
    border: 1px solid rgb(22 163 74 / 0.28);
    border-radius: 9999px;
    background: #ffffff;
    color: #15803d;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: text-top;
}

button.dialogue-selection-completed__badge {
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

button.dialogue-selection-completed__badge:hover,
button.dialogue-selection-completed__badge:focus-visible {
    border-color: rgb(21 128 61 / 0.42);
    background: #f0fdf4;
    color: #166534;
    outline: none;
}
