.empty-state { height: 100%; display: grid; align-content: center; justify-items: center; color: var(--muted); text-align: center; }
.empty-state h2 { margin: 18px 0 4px; color: #596174; font-size: 1.15rem; }
.empty-state p { font-size: .88rem; }
.empty-icon { display: grid; width: 62px; height: 62px; place-items: center; border-radius: 20px; color: #6979d7; background: var(--brand-soft); font-size: 1.2rem; font-weight: 800; }
.conversation-view { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; }
.conversation-view > .conversation-header { grid-row: 1; }
.conversation-view > .recovery-banner { grid-row: 2; }
.conversation-view > .chat-history { grid-row: 3; }
.conversation-view > .draft-list { grid-row: 4; }
.conversation-view > .composer { grid-row: 5; }
.conversation-header { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.conversation-header h2 { display: inline; margin: 0; font-size: 1.08rem; }
.stream-state { margin-left: 8px; color: #748096; font-size: .72rem; }
.stream-state.connected { color: #2d9567; }
.stream-state.failed { color: var(--danger); }
.stream-state.recovering, .stream-state.reconnecting { color: #c27d26; }
.conversation-tools { display: flex; align-items: center; gap: 6px; }
.conversation-more { display: none; }
.conversation-tools .form-select { width: min(230px, 22vw); }
.recovery-banner { padding: 7px 14px; color: #795b19; background: #fff7db; border-bottom: 1px solid #f1dda0; font-size: .8rem; }
.chat-history { position: relative; min-height: 0; overflow: hidden; }
.message-list { height: 100%; overflow-y: auto; padding: 18px clamp(14px, 3vw, 38px); overflow-anchor: none; }
.chat-latest-button { position: absolute; right: 18px; bottom: 12px; z-index: 2; box-shadow: 0 3px 12px #0002; }
.chat-latest-button[hidden] { display: none; }
.message-row { display: flex; margin-bottom: 20px; }
.message-row.user { justify-content: flex-start; }
.message-bubble { min-width: 0; max-width: 88%; padding: 12px 15px; border-radius: 15px; background: #f1f3f6; overflow-wrap: anywhere; }
.message-row.user .message-bubble { color: white; background: var(--brand); border-bottom-left-radius: 5px; }
.message-row.assistant .message-bubble { border: 1px solid #e6e8ed; background: white; border-bottom-left-radius: 5px; box-shadow: 0 3px 14px rgba(31,40,60,.04); }
.message-bubble > :last-child { margin-bottom: 0; }
.message-tools { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.message-tool { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: transparent; color: #667085; }
.message-tool:hover { background: #66708518; }
.message-tool:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.message-row.user .message-tool { color: inherit; }
.message-row.user .message-tool:hover { background: #ffffff22; }
.message-content > :first-child { margin-top: 0; }
.message-content > :last-child { margin-bottom: 0; }
.message-content table { display: block; max-width: 100%; overflow-x: auto; }
.message-content img { max-width: 100%; height: auto; }
.message-content h1, .message-content h2, .message-content h3, .message-content h4, .message-content h5, .message-content h6 { margin: 1rem 0 .55rem; line-height: 1.35; font-weight: 700; }
.message-content h1 { font-size: 1.35rem; }
.message-content h2 { font-size: 1.2rem; }
.message-content h3 { font-size: 1.08rem; }
.message-content h4, .message-content h5, .message-content h6 { font-size: 1rem; }
.message-bubble pre { max-width: 100%; overflow: auto; padding: 12px; border-radius: 9px; color: #e7ecf5; background: #202636; }
.message-bubble code { font-size: .82em; }
.code-block { min-width: 0; max-width: 100%; position: relative; margin: 0 0 1rem; }
.code-block > pre { margin: 0; padding-right: 46px; }
.code-copy-button { position: absolute; z-index: 2; top: 7px; right: 7px; display: grid; width: 32px; height: 32px; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 7px; color: #b7c0d2; background: rgba(21,27,40,.88); }
.code-copy-button:hover, .code-copy-button:focus-visible { color: white; background: #313a4e; }
.code-copy-button.copied { color: #77d7a4; border-color: rgba(119,215,164,.45); }
.code-copy-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.code-copy-success { display: none; }
.code-copy-button.copied .code-copy-default { display: none; }
.code-copy-button.copied .code-copy-success { display: inline-flex; }
.message-meta { margin-bottom: 7px; color: #8c94a3; font-size: .7rem; font-weight: 700; }
.message-row.user .message-meta { color: rgba(255,255,255,.72); text-align: left; }
.message-attachments { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.message-image-attachment { display: flex; flex-direction: column; max-width: 180px; }
.message-image-attachment button { padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: transparent; cursor: zoom-in; }
.message-image-attachment img { width: 160px; height: 120px; object-fit: contain; background: rgba(128,137,155,.12); }
.chat-image-preview { max-width: 94vw; max-height: 94vh; padding: 16px; border: 0; border-radius: 10px; }
.chat-image-preview::backdrop { background: rgba(0,0,0,.75); }
.chat-image-preview button { display: block; margin: 0 0 12px auto; }
.chat-image-preview img { display: block; max-width: 88vw; max-height: 80vh; object-fit: contain; }
.message-attachments a { padding: 4px 8px; border-radius: 7px; color: inherit; background: rgba(128,137,155,.12); font-size: .72rem; text-decoration: none; }
.activity-block { min-width: 0; width: 88%; overflow-wrap: anywhere; margin: -10px 0 16px; padding-left: 13px; border-left: 2px solid #e4e7ee; color: var(--muted); font-size: .78rem; }
.activity-item { margin: 5px 0; }
.activity-item.active { color: #326bc0; }
.activity-item.failed { color: var(--danger); }
.action-card { margin-top: 12px; padding: 11px; border: 1px solid #dfe3eb; border-radius: 10px; color: var(--ink); background: #fafbfc; }
.action-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.action-card p { margin: 6px 0 8px; color: var(--muted); font-size: .78rem; white-space: pre-wrap; }
.test-case-action-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 11px; border: 1px solid #ccd5ff; border-radius: 10px; color: #44528d; background: #f3f5ff; font-size: .78rem; }
.test-case-action-group span { flex: 1 1 180px; }
.test-case-action-group .btn { flex: 0 0 auto; }
.action-review-mode { display: flex; align-items: center; gap: 8px; margin: 9px 0; color: var(--muted); font-size: .78rem; }
.action-review-mode .form-select { width: auto; min-width: 230px; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-choices { max-height: 12rem; overflow-y: auto; border: 1px solid #ddd; border-radius: .5rem; padding: .4rem; margin-bottom: .4rem; }
.skill-choice { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-radius: .3rem; padding: .5rem; }
.skill-choice:hover, .skill-choice:focus { background: #eef4ff; }
.skill-choice small { display: block; color: #666; white-space: normal; }
.selected-skill { display: flex; align-items: center; gap: .4rem; padding-bottom: .4rem; }
.selected-skill[hidden], .skill-choices[hidden] { display: none; }

.remote-execution { margin-top: 10px; }
.remote-command { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: .85rem; }
.remote-command dd { margin: 0; overflow-wrap: anywhere; }
.remote-status { font-weight: 700; }
.action-card .remote-status.success { color: #187348; }
.action-card .remote-status.danger { color: var(--danger); }
.remote-result { margin: 12px 0; border-top: 1px solid var(--line); padding-top: 10px; }
.remote-result h4 { font-size: .9rem; }
.remote-output { margin: 10px 0; }
.remote-output header { margin-bottom: 4px; }
.remote-execution pre { white-space: pre; max-height: 20rem; overflow: auto; font-size: .8rem; }
.remote-execution details { margin: 10px 0; }
.remote-controls { display: flex; gap: 8px; margin-top: 10px; }

@media (max-width: 820px) { .activity-block { width: 95%; } }
