* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
}

h1 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.entry {
    margin-bottom: 20px;
    border-left: 3px solid transparent;
    padding-left: 15px;
    transition: all 0.2s ease;
}

.entry {
    padding: 10px 15px;
    border-radius: 4px;
}

.entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #666;
}

.role {
    font-weight: bold;
    text-transform: capitalize;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    color: white;
}

.timestamp {
    color: #999;
    font-size: 0.85em;
}

.content {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.tool-calls {
    margin-top: 10px;
}

.tool-call {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 10px;
    margin: -10px;
    border-radius: 4px;
    padding-right: 150px; /* Make room for the tool ID */
}

.tool-header:hover {
    background: #e9ecef;
}

.tool-name {
    font-weight: bold;
    color: #495057;
}

.tool-description {
    color: #6c757d;
    font-size: 0.9em;
}

.tool-id {
    position: absolute;
    right: 10px;
    color: #999;
    font-size: 0.85em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.tool-id-copy {
    margin-bottom: 10px;
    color: #666;
    font-size: 0.9em;
}

.expand-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s;
}

.tool-call.expanded > .tool-header > .expand-icon {
    transform: rotate(90deg);
}

.tool-details {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

/* Only show tool-details when the immediate parent tool-call has expanded class */
.tool-call.expanded > .tool-details {
    display: block;
}

.tool-input {
    background: #f1f3f5;
    padding: 10px;
    border-radius: 4px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    font-size: 1em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.4;
}

.tool-input pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.tool-result {
    background: #e3f2fd;
    padding: 10px;
    border-radius: 4px;
    margin-top: 5px;
    white-space: pre-wrap;
}

.tool-result.error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

.children {
    margin-left: 20px;
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px dashed #ddd;
}

.task-children {
    background: #fafafa;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

code {
    background: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

pre code {
    background: none;
    padding: 0;
}

/* Token details toggle styles */
.token-toggle {
    cursor: pointer;
    user-select: none;
    font-size: 0.85em;
    color: #666;
}

.token-toggle:hover {
    color: #333;
}

.token-details {
    display: none;
    color: #999;
    font-size: 0.85em;
    margin-left: 5px;
}

.token-details.show {
    display: inline;
}

.token-expand-icon {
    display: inline-block;
    font-family: monospace;
}