/* ============================================================
   Output — Live output, capture blocks, syntax highlighting,
            xterm container
   ============================================================ */

/* ── Live Body ─────────────────────────────────────────────── */

.live-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: row;
}

.live-left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ── Output Scroll ─────────────────────────────────────────── */

.output-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.output-scroll .line {
    padding: 1px 0;
}

.output-scroll .line.status-line {
    color: var(--accent);
    font-weight: 600;
}

.output-scroll .line.summary-line {
    color: var(--warning);
    font-weight: 600;
}

.capture-text {
    color: var(--text-secondary);
}

/* ── xterm.js Container ────────────────────────────────────── */

.xterm-container {
    flex: 1;
    min-height: 0;
    padding: 4px 4px 12px;
    background: var(--bg-primary);
}

.xterm-container .xterm {
    height: 100%;
}

.xterm-container .xterm-viewport::-webkit-scrollbar {
    width: 6px;
}

.xterm-container .xterm-viewport::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.xterm-container.xterm-focused {
    outline: 1px solid var(--accent-primary, #58a6ff);
    outline-offset: -1px;
    border-radius: 4px;
}

.xterm-focus-hint {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.6;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.2s;
}

.xterm-container.xterm-focused .xterm-focus-hint {
    opacity: 0;
}

.selection-pause-badge {
    position: absolute;
    top: 8px;
    right: 12px;
    background: var(--warning);
    color: var(--bg-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    pointer-events: none;
    opacity: 0.9;
    z-index: 10;
}

/* ── Capture Blocks ────────────────────────────────────────── */

.capture-block {
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-left: 3px solid transparent;
}

.capture-block-text {
    background: var(--capture-text-bg);
    border-left-color: var(--border);
}

.capture-block-tool {
    background: var(--capture-tool-bg);
    border-left-color: var(--accent-dim);
}

.capture-block-user {
    background: var(--capture-user-bg);
    border-left-color: #7c3aed;
}

.capture-block-pulse {
    background: var(--capture-pulse-bg);
    border-left-color: var(--success);
}

.capture-block-status {
    background: transparent;
    border-left-color: transparent;
    padding: 4px 12px;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.capture-block-statusbar {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-light);
    border-radius: 6px;
    padding: 6px 12px;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 11px;
}

.capture-line {
    white-space: pre;
    min-height: 1.4em;
}

.capture-separator {
    color: var(--success);
}

.capture-user-input {
    color: var(--capture-user-color);
    font-weight: 500;
}

.capture-tool-header {
    color: var(--accent);
    font-weight: 600;
}

.capture-tool-result {
    color: var(--text-muted);
}

.capture-code {
    background: var(--capture-code-bg);
    border-radius: 2px;
}

.capture-diff-add {
    background: var(--diff-add-bg);
    border-radius: 2px;
    color: var(--diff-add-color);
}

.capture-diff-del {
    background: var(--diff-del-bg);
    border-radius: 2px;
    color: var(--diff-del-color);
    text-decoration: line-through;
    text-decoration-color: rgba(248, 81, 73, 0.4);
}

.capture-diff-summary {
    color: var(--accent);
    font-weight: 600;
}

.sh-diff-gutter-add {
    color: var(--diff-add-color);
    font-weight: 700;
    user-select: none;
}

.sh-diff-gutter-del {
    color: var(--diff-del-color);
    font-weight: 700;
    user-select: none;
}

/* ── Syntax Highlighting ───────────────────────────────────── */

.sh-gutter {
    color: var(--text-muted);
    user-select: none;
}

.sh-keyword   { color: var(--sh-keyword); }
.sh-string    { color: var(--sh-string); }
.sh-comment   { color: var(--sh-comment); font-style: italic; }
.sh-number    { color: var(--sh-number); }
.sh-builtin   { color: var(--sh-builtin); }
.sh-decorator { color: var(--sh-decorator); }

/* ── Drop Overlay (image drag-and-drop) ────────────────────── */

.drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.12);
    border: 2px dashed var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    pointer-events: none;
}

.drop-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
}

.drop-overlay-content svg {
    opacity: 0.8;
}

/* ── Image Attachments Bar ─────────────────────────────────── */

.image-attachments {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

.image-attachment {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 4px 8px 4px 4px;
    max-width: 220px;
}

.image-attachment img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.image-attachment-name {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.image-attachment-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
}

.image-attachment-remove:hover {
    color: var(--danger);
}
