.fi-chat-transcript {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 0.5rem 0;
}

.fi-chat-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fi-chat-row[data-align='start'] { align-items: flex-start; }
.fi-chat-row[data-align='end']   { align-items: flex-end; }
.fi-chat-row[data-align='center']{ align-items: center; }

.fi-chat-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0 0.25rem;
    font-size: 0.75rem;
}

.fi-chat-meta-name { font-weight: 600; }
.fi-chat-meta-time { color: #9ca3af; }

.fi-chat-bubble {
    max-width: 78%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    line-height: 1.55;
    border-radius: 1rem;
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    color: #111827;
}

.fi-chat-bubble[data-role='judge'],
.fi-chat-bubble[data-role='orchestrator'] { max-width: 720px; }

.fi-chat-bubble[data-role='persona']      { background: #ecfdf5; border-color: #a7f3d0; }
.fi-chat-bubble[data-role='sut']          { background: #eff6ff; border-color: #bfdbfe; }
.fi-chat-bubble[data-role='judge']        { background: #eef2ff; border-color: #c7d2fe; }
.fi-chat-bubble[data-role='orchestrator'] { background: #f3f4f6; border-color: #e5e7eb; }

.fi-chat-row[data-role='persona']      .fi-chat-meta-name { color: #047857; }
.fi-chat-row[data-role='sut']          .fi-chat-meta-name { color: #1d4ed8; }
.fi-chat-row[data-role='judge']        .fi-chat-meta-name { color: #4338ca; }
.fi-chat-row[data-role='orchestrator'] .fi-chat-meta-name { color: #6b7280; }

.fi-chat-bubble p { margin: 0.25rem 0; }
.fi-chat-bubble p:first-child { margin-top: 0; }
.fi-chat-bubble p:last-child  { margin-bottom: 0; }
.fi-chat-bubble strong { font-weight: 600; }
.fi-chat-bubble a { color: #2563eb; text-decoration: underline; }
.fi-chat-bubble ul,
.fi-chat-bubble ol { margin: 0.25rem 0; padding-left: 1.25rem; }
.fi-chat-bubble code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    font-size: 0.85em;
}
.fi-chat-bubble pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-size: 0.8rem;
}
.fi-chat-bubble pre code { background: transparent; padding: 0; }

.fi-chat-empty {
    padding: 1.5rem;
    text-align: center;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.fi-chat-judgment {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1rem 1.125rem;
    margin-bottom: 0.5rem;
    border-left-width: 4px;
}

.fi-chat-judgment[data-verdict='pass']         { border-left-color: #10b981; }
.fi-chat-judgment[data-verdict='fail']         { border-left-color: #ef4444; }
.fi-chat-judgment[data-verdict='inconclusive'] { border-left-color: #f59e0b; }
.fi-chat-judgment:not([data-verdict])          { border-left-color: #9ca3af; }

.fi-chat-judgment-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.fi-chat-judgment-icon {
    width: 1.125rem;
    height: 1.125rem;
    color: #4b5563;
}

.fi-chat-judgment-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.fi-chat-judgment-score {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: auto;
}

.fi-chat-judgment-body {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: #374151;
}

.fi-chat-judgment-body p { margin: 0.25rem 0; }
.fi-chat-judgment-body p:first-child { margin-top: 0; }
.fi-chat-judgment-body p:last-child  { margin-bottom: 0; }
.fi-chat-judgment-body strong { font-weight: 600; }
.fi-chat-judgment-body ul, .fi-chat-judgment-body ol { margin: 0.25rem 0; padding-left: 1.25rem; }

.dark .fi-chat-bubble                          { color: #e5e7eb; border-color: rgba(255, 255, 255, 0.08); }
.dark .fi-chat-bubble[data-role='persona']     { background: rgba(16, 185, 129, 0.14); }
.dark .fi-chat-bubble[data-role='sut']         { background: rgba(59, 130, 246, 0.14); }
.dark .fi-chat-bubble[data-role='judge']       { background: rgba(99, 102, 241, 0.16); }
.dark .fi-chat-bubble[data-role='orchestrator']{ background: rgba(255, 255, 255, 0.06); }
.dark .fi-chat-row[data-role='persona']      .fi-chat-meta-name { color: #6ee7b7; }
.dark .fi-chat-row[data-role='sut']          .fi-chat-meta-name { color: #93c5fd; }
.dark .fi-chat-row[data-role='judge']        .fi-chat-meta-name { color: #a5b4fc; }
.dark .fi-chat-row[data-role='orchestrator'] .fi-chat-meta-name { color: #9ca3af; }
.dark .fi-chat-bubble code { background: rgba(255, 255, 255, 0.08); }
.dark .fi-chat-bubble pre  { background: rgba(255, 255, 255, 0.05); }
.dark .fi-chat-bubble a    { color: #60a5fa; }
.dark .fi-chat-empty       { background: rgba(255, 255, 255, 0.04); color: #9ca3af; }

.dark .fi-chat-judgment {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}
.dark .fi-chat-judgment-icon  { color: #9ca3af; }
.dark .fi-chat-judgment-title { color: #f9fafb; }
.dark .fi-chat-judgment-score { color: #9ca3af; }
.dark .fi-chat-judgment-body  { color: #d1d5db; }

/* SUT snapshot card (sut_snapshot raw_payload) */
.fi-chat-bubble-snapshot { width: 100%; max-width: 720px; }

.fi-chat-snapshot-card {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.fi-chat-snapshot-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fi-chat-snapshot-icon {
    width: 1.125rem;
    height: 1.125rem;
    color: #4b5563;
    flex-shrink: 0;
}

.fi-chat-snapshot-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
}

.fi-chat-snapshot-stats {
    margin-left: auto;
    font-size: 0.75rem;
    color: #6b7280;
}

.fi-chat-snapshot-empty {
    font-size: 0.8125rem;
    color: #6b7280;
    padding: 0.25rem 0;
}

.fi-chat-snapshot-section {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.fi-chat-snapshot-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fi-chat-snapshot-item {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.625rem;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fi-chat-snapshot-item-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.fi-chat-snapshot-item-icon {
    width: 1rem;
    height: 1rem;
    color: #4b5563;
    flex-shrink: 0;
}

.fi-chat-snapshot-item-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
}

.fi-chat-snapshot-item-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.fi-chat-snapshot-item-body {
    font-size: 0.8125rem;
    color: #374151;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.fi-chat-snapshot-detail {
    margin-top: 0.125rem;
    font-size: 0.75rem;
}

.fi-chat-snapshot-detail > summary {
    cursor: pointer;
    color: #6b7280;
    user-select: none;
    padding: 0.125rem 0;
    font-weight: 500;
}

.fi-chat-snapshot-detail > summary:hover { color: #374151; }

.fi-chat-snapshot-detail pre {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 0.375rem;
    padding: 0.5rem 0.625rem;
    margin: 0.375rem 0 0;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    line-height: 1.4;
    color: #1f2937;
    white-space: pre-wrap;
    word-break: break-word;
}

.dark .fi-chat-snapshot-icon { color: #9ca3af; }
.dark .fi-chat-snapshot-title { color: #f9fafb; }
.dark .fi-chat-snapshot-stats { color: #9ca3af; }
.dark .fi-chat-snapshot-empty { color: #9ca3af; }
.dark .fi-chat-snapshot-section-title { color: #d1d5db; }
.dark .fi-chat-snapshot-item {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}
.dark .fi-chat-snapshot-item-icon { color: #9ca3af; }
.dark .fi-chat-snapshot-item-code { color: #f9fafb; }
.dark .fi-chat-snapshot-item-meta { color: #9ca3af; }
.dark .fi-chat-snapshot-item-body { color: #d1d5db; }
.dark .fi-chat-snapshot-detail > summary { color: #9ca3af; }
.dark .fi-chat-snapshot-detail > summary:hover { color: #e5e7eb; }
.dark .fi-chat-snapshot-detail pre { background: rgba(255, 255, 255, 0.05); color: #e5e7eb; }
