.thought-block {
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 0.8125rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.thought-header {
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.25rem;
    min-height: 1.25em;
}

.reasoning-log-wrap {
    margin-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.5rem;
}

.reasoning-log-summary {
    cursor: pointer;
    color: #6b7280;
    font-size: 0.75rem;
    user-select: none;
    list-style: none;
}

.reasoning-log-summary::-webkit-details-marker {
    display: none;
}

.reasoning-log-summary::before {
    content: '\25B8 ';
    margin-right: 0.25rem;
}

.reasoning-log-wrap[open] .reasoning-log-summary::before {
    content: '\25BE ';
}

.reasoning-log-list {
    margin-top: 0.35rem;
    font-family: 'Consolas', 'Monaco', 'SF Mono', monospace;
    font-size: 0.7rem;
    color: #6b7280;
    line-height: 1.5;
    max-height: 12rem;
    overflow-y: auto;
}

.reasoning-log-item {
    padding: 0.15rem 0;
    border-left: 2px solid #e5e7eb;
    padding-left: 0.5rem;
    margin-bottom: 0.15rem;
}

.reasoning-log-item.complete {
    border-left-color: #94a3b8;
    color: #94a3b8;
}

.reasoning-log-item.error {
    border-left-color: #dc2626;
    color: #b91c1c;
}

.run-log-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.run-log-item .run-log-icon {
    flex-shrink: 0;
    width: 1em;
    color: #6b7280;
}

.run-log-item .run-log-icon.done {
    color: #10b981;
}

.run-log-item .run-log-icon.error {
    color: #dc2626;
}

.run-log-item .run-log-text {
    flex: 1;
}

.run-log-item.run-log-substep {
    margin-left: 1.25rem;
    border-left-color: #94a3b8;
    padding-left: 0.4rem;
}

.thought-block-completed .thought-header {
    color: #9ca3af;
}

.llm-reasoning-wrap .llm-reasoning-body {
    font-family: 'Consolas', 'Monaco', 'SF Mono', monospace;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 14rem;
    overflow-y: auto;
    margin-top: 0.35rem;
    padding: 0.35rem 0;
}

.thought-block-completed .reasoning-log-wrap {
    opacity: 0.9;
}

.thought-block-completed {
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.thought-block-completed.thought-block-notion {
    background: #ffffff;
    border-left-color: #94a3b8;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

/* Notion-like Live Run Log */
.thought-block-notion {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #0ea5e9;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.thought-block-notion .run-log-thought {
    margin-top: 0;
    padding: 0.5rem 0;
}

.run-log-thought-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.35rem;
    cursor: pointer;
    user-select: none;
    border-radius: 6px;
    padding: 0.15rem 0;
    transition: background-color 0.15s ease;
}

.run-log-thought-header:hover {
    background-color: #f9fafb;
}

.run-log-icon-lightbulb {
    width: 1.1em;
    height: 1.1em;
    background: radial-gradient(circle at 35% 35%, #fef08a, #eab308);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.4);
}

.run-log-thought-title {
    flex: 1;
}

.run-log-thought.is-collapsed .run-log-thought-body-wrap {
    display: none;
}

.run-log-react-active .run-log-thought-body,
.run-log-react-active .run-log-checklist {
    display: none !important;
}

.run-log-thought.is-collapsed .run-log-expand-arrow {
    transform: rotate(45deg);
}

.run-log-expand-arrow {
    width: 0.5em;
    height: 0.5em;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(-45deg);
    margin-left: 0.25rem;
    transition: transform 0.2s ease;
}

.run-log-thought-body {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    padding-left: 1.5em;
}

.run-log-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.run-log-check-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #374151;
}

.run-log-check-item.pending .run-log-check-label {
    color: #9ca3af;
}

.run-log-check-item.pending .run-log-circle {
    border-color: #e5e7eb;
    background: #f8fafc;
}

.run-log-check-item.completed .run-log-check-label {
    color: #9ca3af;
}

.run-log-check-item.error .run-log-check-label {
    color: #b91c1c;
}

.run-log-circle {
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    border-radius: 50%;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.run-log-circle.in-progress {
    border-style: dotted;
    border-color: #6b7280;
    background: #f8fafc;
}

.run-log-circle.completed {
    border-color: #10b981;
    background: #10b981;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 0.65em 0.65em;
    background-position: center;
    background-repeat: no-repeat;
}

.run-log-circle.error {
    border-color: #dc2626;
    background: #dc2626;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
    background-size: 0.6em 0.6em;
    background-position: center;
    background-repeat: no-repeat;
}

.run-log-check-item.skipped .run-log-check-label {
    color: #6b7280;
    text-decoration: line-through;
    font-style: italic;
}

.run-log-check-item.skipped .run-log-circle {
    border-color: #94a3b8;
    background: #e5e7eb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2.5' fill='none' stroke-linecap='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E");
    background-size: 0.65em 0.65em;
    background-position: center;
    background-repeat: no-repeat;
}

.run-log-check-item.skipped {
    opacity: 0.9;
}

.run-log-check-label {
    flex: 1;
}

/* Steps with reasoning inside */
.run-log-steps {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.5rem;
}

.run-log-step {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.run-log-step summary {
    list-style: none;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    font-size: 0.8125rem;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.12s ease;
}

.run-log-step summary::-webkit-details-marker {
    display: none;
}

.run-log-step summary::before {
    content: '\25B8';
    font-size: 0.7em;
    color: #6b7280;
    transition: transform 0.2s ease;
}

.run-log-step[open] summary::before {
    transform: rotate(90deg);
}

.run-log-step summary:hover {
    background-color: #f9fafb;
}

.run-log-step-label {
    flex: 1;
    font-weight: 500;
}

.run-log-step.pending .run-log-step-label {
    color: #9ca3af;
}

.run-log-step.in-progress .run-log-step-label {
    color: #111827;
}

.run-log-step.completed .run-log-step-label,
.run-log-step.run-log-step-done .run-log-step-label {
    color: #6b7280;
}

.run-log-step-body {
    padding: 0.5rem 0.75rem 0.5rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    font-family: 'Consolas', 'Monaco', 'SF Mono', monospace;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 12rem;
    overflow-y: auto;
    background: #f8fafc;
}

.run-log-step-body[data-placeholder="1"] {
    color: #9ca3af;
    font-style: italic;
}

.run-log-details-summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #0f766e;
    font-size: 0.8125rem;
}

.run-log-icon-chain {
    width: 1em;
    height: 1em;
    border: 1.5px solid #0ea5e9;
    border-radius: 2px;
    position: relative;
}

.run-log-icon-chain::after {
    content: '';
    position: absolute;
    width: 0.6em;
    height: 0.6em;
    border: 1.5px solid #0ea5e9;
    border-radius: 2px;
    top: 0.2em;
    left: 0.2em;
}

.run-log-chevron {
    width: 0.5em;
    height: 0.5em;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(45deg);
    margin-left: auto;
    transition: transform 0.2s;
}

.run-log-details[open] .run-log-chevron {
    transform: rotate(-135deg);
}

.run-log-group-header .run-log-chevron {
    margin-left: 0.25rem;
}

.run-log-group.is-open .run-log-group-chevron {
    transform: rotate(-135deg);
}

.run-log-group:not(.is-open) .run-log-group-chevron {
    transform: rotate(45deg);
}

.run-log-groups {
    margin-top: 0.5rem;
    padding-left: 0;
    max-height: 18rem;
    overflow-y: auto;
}

.run-log-group {
    margin-bottom: 0.5rem;
}

.run-log-group-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8125rem;
    color: #111827;
    padding: 0.25rem 0;
    user-select: none;
}

.run-log-group-header:hover {
    color: #111827;
    background-color: #f9fafb;
    border-radius: 4px;
}

.run-log-group-title {
    flex: 1;
    min-width: 0;
}

.run-log-group-subtitle {
    flex: 0 0 auto;
    font-weight: 400;
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 0.35rem;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.run-log-group-body {
    border-left: 2px solid #e5e7eb;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    transition: opacity 0.15s ease;
}

.run-log-group:not(.is-open) .run-log-group-body {
    display: none;
}

.run-log-tree-item.run-log-substep {
    padding-left: 0.5rem;
    margin-left: 0.25rem;
    border-left: 1px solid #e5e7eb;
}

.run-log-tree-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
    font-size: 0.8125rem;
    color: #374151;
    position: relative;
}

.run-log-tree-item.complete .run-log-text {
    color: #6b7280;
}

.run-log-tree-item.error .run-log-text {
    color: #b91c1c;
}

.run-log-tree-icon {
    flex-shrink: 0;
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background: #9ca3af;
}

.run-log-tree-icon.square-check {
    width: 0.75em;
    height: 0.75em;
    border-radius: 2px;
    background: #10b981;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E");
    background-size: 0.55em 0.55em;
    background-position: center;
    background-repeat: no-repeat;
}

.run-log-tree-icon.error {
    background: #dc2626;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E");
    background-size: 0.5em 0.5em;
    background-position: center;
    background-repeat: no-repeat;
}

.run-log-tree-item .run-log-text {
    flex: 1;
}

.run-log-tree-item-appear {
    animation: runLogItemAppear 0.25s ease-out forwards;
}

@keyframes runLogItemAppear {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ChatGPT-style single reasoning block */
.gpt-reasoning-block {
    margin: 0.5rem 0;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    font-size: 0.85rem;
    width: 100%;
    min-width: 280px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.gpt-reasoning-summary {
    cursor: pointer;
    padding: 0.75rem 1rem;
    font-weight: 500;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    transition: background-color 0.2s;
    border-bottom: 1px solid transparent;
}

.gpt-reasoning-summary:hover {
    background-color: #f8fafc;
}

.gpt-reasoning-block[open] .gpt-reasoning-summary {
    border-bottom-color: #e5e7eb;
}

.gpt-reasoning-summary::-webkit-details-marker {
    display: none;
}

.gpt-reasoning-summary::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid #6b7280;
    border-bottom: 2px solid #6b7280;
    transform: rotate(45deg);
    margin-left: auto;
    transition: transform 0.2s ease;
}

.gpt-reasoning-block[open] .gpt-reasoning-summary::after {
    transform: rotate(225deg);
    margin-top: 4px;
}

.gpt-reasoning-icon {
    font-size: 1.1em;
    line-height: 1;
}

.gpt-reasoning-icon.spinning {
    display: inline-block;
    animation: spin 1.5s linear infinite;
}

.gpt-reasoning-content {
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #f8fafc;
}

.gpt-step-item {
    color: #111827;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.85rem;
}

.gpt-step-item::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
}

.gpt-llm-text {
    border-left: 2px solid #e5e7eb;
    padding-left: 0.75rem;
    margin-left: 0.25rem;
    margin-top: 0.25rem;
    color: #6b7280;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
    line-height: 1.5;
    font-size: 0.8rem;
}

.gpt-llm-text:empty {
    display: none;
}

.gpt-llm-text .reasoning-placeholder {
    color: #9ca3af;
    font-style: italic;
    font-family: inherit;
    font-size: 0.85rem;
}

/* Streaming preview in agent left panel */
.agent-streaming-preview {
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-200);
    box-shadow: var(--shadow-card);
}

.agent-streaming-preview-label {
    font-size: var(--font-small);
    font-weight: 600;
    color: var(--neutral-500);
    margin-bottom: var(--space-1);
}

.agent-streaming-preview-text {
    font-size: var(--font-small);
    line-height: 1.45;
    color: var(--neutral-900);
    min-height: 1.25em;
}

.agent-streaming-preview-text .streaming-cursor {
    display: inline;
    animation: blink 1s step-end infinite;
}

.streaming-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--color-primary);
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

