/* The chat list, the transcript, the composer and the files panel. */
.chat-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.chat-row { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.chat-row:hover { background: var(--surface-2); }
.chat-row.current { background: var(--surface-2); font-weight: 600; }
.chat-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex: none; }
.chat-row .dot.running { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.chat-row .dot.done { background: var(--ok); }
.chat-row .dot.failed { background: var(--danger); }
.chat-row .dot.cancelled { background: var(--warn); }
.chat-row .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .agent { color: var(--muted); font-size: 11.5px; font-weight: 400; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .chat-row .dot.running { animation: none; } }

.status { font-size: 12px; color: var(--muted); }
.status.running { color: var(--accent); }
.status.failed { color: var(--danger); }

.transcript { flex: 1; overflow-y: auto; padding: 16px; scroll-behavior: smooth; }
.transcript > div { max-width: 820px; margin: 0 auto; }
.empty { display: grid; gap: 10px; padding: 32px 0; text-align: center; }
.empty label { display: inline-flex; flex-direction: column; gap: 6px; justify-self: center; }
.empty select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--surface); min-width: 220px; }
.welcome { font-size: 18px; margin: 0; }

.turn { margin: 0 0 14px; display: flex; flex-direction: column; }
.turn.user { align-items: flex-end; }
.turn.user .bubble { background: var(--accent); color: #fff; border-radius: 16px 16px 4px 16px; padding: 9px 13px; max-width: 85%; white-space: pre-wrap; word-break: break-word; }
.turn.assistant .bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 10px 14px; max-width: 95%; overflow-wrap: anywhere; }
.turn.assistant .bubble > :first-child { margin-top: 0; }
.turn.assistant .bubble > :last-child { margin-bottom: 0; }
.bubble pre { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; overflow-x: auto; font: 13px/1.45 var(--mono); }
.bubble code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.bubble pre code { background: none; padding: 0; }
.bubble table { border-collapse: collapse; margin: 8px 0; font-size: 14px; }
.bubble td, .bubble th { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
.bubble blockquote { margin: 8px 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.bubble img { max-width: 100%; border-radius: 8px; }

.tool { margin: 4px 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; max-width: 95%; }
.tool summary { cursor: pointer; padding: 6px 10px; display: flex; align-items: center; gap: 8px; color: var(--muted); list-style: none; }
.tool summary::-webkit-details-marker { display: none; }
.tool summary .name { font-family: var(--mono); color: var(--text); }
.tool summary .arg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tool summary .spin { width: 10px; height: 10px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.tool.error summary .name { color: var(--danger); }
.tool pre { margin: 0; border-top: 1px solid var(--line); padding: 8px 10px; max-height: 260px; overflow: auto; font: 12.5px/1.4 var(--mono); white-space: pre-wrap; }
@keyframes spin { to { transform: rotate(360deg); } }
.divider { text-align: center; color: var(--muted); font-size: 12px; margin: 10px 0; }
.thinking { color: var(--muted); font-size: 13px; font-style: italic; }
.queued { color: var(--muted); font-size: 12.5px; margin: 4px 0 10px; }

.composer { display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { flex: 1; resize: none; max-height: 40vh; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; background: var(--bg); line-height: 1.4; }
.composer textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 0; }
.send { background: var(--accent); color: #fff; }
.send:hover { background: var(--accent); filter: brightness(1.08); color: #fff; }
.send:disabled { opacity: .4; cursor: default; }
.stop { color: var(--danger); }

.file-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.file-list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13.5px; }
.file-list li:hover { background: var(--surface-2); }
.file-list a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.file-list .size { color: var(--muted); font-size: 12px; }
.file-list .none { color: var(--muted); padding: 12px 8px; }
