/* Topic bar and topic list of project and digital employee conversations. */
.conversation-topic-bar { display: flex; align-items: center; gap: 8px; flex-shrink: 0; min-height: 40px; padding: 4px 12px; border-bottom: 1px solid var(--cf-line, #e5e7eb); background: var(--cf-panel, #fff); }
.conversation-topic-bar[hidden] { display: none; }
.conversation-topic-bar .topic-bar-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; color: var(--cf-text, #111827); text-align: left; }
.conversation-topic-bar .topic-bar-rename { border: 0; background: transparent; padding: 6px 4px; border-radius: 6px; cursor: text; }
.conversation-topic-bar .topic-bar-rename:hover:not(:disabled) { background: var(--cf-hover, #f4f4f5); }
.conversation-topic-bar .topic-bar-rename:disabled { cursor: default; color: var(--cf-muted, #6b7280); }
.conversation-topic-bar .topic-bar-rename:not(:disabled) { flex: 0 1 auto; }
.conversation-topic-bar .topic-bar-edit { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: auto; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--cf-muted, #6b7280); cursor: pointer; }
.conversation-topic-bar .topic-bar-edit:hover { background: var(--cf-hover, #f4f4f5); color: var(--cf-text, #111827); }
.conversation-topic-bar .topic-bar-input { flex: 1; min-width: 0; font-size: 14px; padding: 6px 8px; border: 1px solid var(--cf-line-strong, #d1d5db); border-radius: 6px; background: var(--cf-raised, #fff); color: var(--cf-text, #111827); }
.conversation-topic-bar .topic-bar-list { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: var(--cf-hover, #f4f4f5); color: var(--cf-text-2, #4b5563); cursor: pointer; }
.conversation-topic-bar .topic-bar-list:hover { background: var(--cf-line, #e5e7eb); color: var(--cf-text, #111827); }
.topic-list { display: flex; flex-direction: column; gap: 6px; padding: 12px 4px; }
.topic-item { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 10px 14px; border: 1px solid var(--cf-line, #e5e7eb); border-radius: 10px; background: var(--cf-raised, #fff); color: var(--cf-text, #111827); text-align: left; cursor: pointer; font: inherit; }
.topic-item:hover { background: var(--cf-hover, #f4f4f5); }
.topic-item:focus-visible { outline: 2px solid #667eea; outline-offset: 1px; }
.topic-item-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topic-item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 700; line-height: 1.4; color: var(--cf-text, #111827); }
/* Same spinner as a running project in the conversation list. */
.topic-item-running { flex-shrink: 0; display: inline-block; width: 14px; height: 14px; border: 2px solid #e5e7eb; border-top-color: #667eea; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
html[data-theme] .topic-item-running { border-color: var(--cf-line-strong); border-top-color: var(--cf-text); }
.topic-item-draft { flex-shrink: 0; padding: 1px 8px; border-radius: 999px; background: #fee2e2; color: #b91c1c; font-size: 12px; }
.topic-item-draft-label { color: #dc2626; }
.topic-item-awaiting-input { flex-shrink: 0; padding: 1px 8px; border-radius: 999px; background: #f97316; color: #fff; font-size: 12px; font-weight: 600; }
.topic-item-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.4; color: var(--cf-faint, #9ca3af); }
.topic-item-preview { display: -webkit-box; flex-shrink: 0; height: 3em; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; line-height: 1.5; font-size: 13px; color: var(--cf-text-2, #4b5563); }
.topic-item-code { padding: 0 4px; border-radius: 4px; background: var(--cf-code, #f3f4f6); font-family: var(--cf-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; }
.topic-list .topic-more { align-self: center; margin-top: 4px; }
.topic-empty { padding: 32px 16px; text-align: center; font-size: 14px; color: var(--cf-muted, #6b7280); }
.topic-empty button { border: 0; background: transparent; color: #4f46e5; cursor: pointer; font: inherit; }
.topic-tools { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.topic-search { flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid var(--cf-line-strong, #d1d5db); border-radius: 8px; background: var(--cf-raised, #fff); color: var(--cf-text, #111827); font: inherit; font-size: 14px; }
.topic-search[hidden] { display: none; }
.conversation-topic-bar .topic-search-toggle, html[data-theme] .conversation-topic-bar .topic-search-toggle { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; padding-inline: 7px; }
.conversation-topic-bar .topic-search-toggle[aria-expanded="true"], html[data-theme] .conversation-topic-bar .topic-search-toggle[aria-expanded="true"] { background: var(--cf-hover, #f4f4f5); color: var(--cf-text, #111827); }
.topic-search-toggle svg { display: block; width: 16px; height: 16px; }
.topic-scope-count { margin-left: 3px; font-size: 11px; font-weight: 400; opacity: .6; font-variant-numeric: tabular-nums; }
.topic-scope-count[hidden] { display: none; }
.topic-scope { display: flex; flex-shrink: 0; gap: 4px; }
.topic-scope-option[aria-pressed="true"], html[data-theme] .topic-scope-option[aria-pressed="true"] { border-color: var(--cf-accent, #111827); background: var(--cf-accent, #111827); color: var(--cf-on-accent, #fff); }
/* Where the composer sends (Dot or a topic), topic states, the list sections and the "from Dot" dialog. */
.conversation-topic-bar .topic-bar-place { flex-shrink: 0; padding: 2px 8px; border-radius: 6px; background: var(--cf-hover, #f4f4f5); color: var(--cf-text-2, #4b5563); font-size: 12px; font-weight: 600; }
.conversation-topic-bar .topic-bar-place.is-dot { background: #e0e7ff; color: #4338ca; }
.topic-item-closed, .topic-item-dot { flex-shrink: 0; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.topic-item-closed { background: #f3f4f6; color: #6b7280; }
.topic-item-dot { background: #e0e7ff; color: #4338ca; }
.topic-item.is-dot { border-color: #c7d2fe; }
.topic-background { margin: 8px 4px; padding: 8px 12px; border: 1px dashed var(--cf-line-strong, #d1d5db); border-radius: 8px; background: var(--cf-raised, #fff); font-size: 13px; color: var(--cf-text-2, #4b5563); }
.topic-background summary { cursor: pointer; font-weight: 600; }
.topic-background-text { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }
.topic-closed-note { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 12px 4px; padding: 10px; border-radius: 8px; background: var(--cf-hover, #f4f4f5); font-size: 13px; color: var(--cf-muted, #6b7280); }
.topic-dialog { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.4); }
.topic-dialog-panel { display: flex; flex-direction: column; gap: 10px; width: min(560px, 100%); max-height: 85vh; padding: 16px; border-radius: 12px; background: var(--cf-panel, #fff); color: var(--cf-text, #111827); }
.topic-dialog-panel h3 { margin: 0; font-size: 16px; }
.topic-dialog-title { padding: 8px 10px; border: 1px solid var(--cf-line-strong, #d1d5db); border-radius: 8px; background: var(--cf-raised, #fff); color: inherit; font: inherit; }
.topic-dialog-hint { margin: 0; font-size: 12px; color: var(--cf-muted, #6b7280); }
.topic-dialog-list { flex: 1; min-height: 80px; overflow: auto; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.topic-dialog-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.topic-dialog-item:hover { background: var(--cf-hover, #f4f4f5); }
.topic-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
