:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --header-color: #2c3e50;
    --task-list-bg: #f9f9f9;
    --task-item-bg: #ffffff;
    --border-color: #dddddd;
    --adding-color: #e6ffe6;
    --removing-color: #ffe6e6;
    --notification-color: #ffff99;
    --notification-hover-color: #ffff66;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --header-color: #61dafb;
    --task-list-bg: #2a2a2a;
    --task-item-bg: #333333;
    --border-color: #444444;
    --adding-color: #1a4d1a;
    --removing-color: #4d1a1a;
    --notification-color: #4d4d00;
    --notification-hover-color: #666600;
}


body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2 {
    color: var(--header-color);
}

.task-list {
    background-color: var(--task-list-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 20px;
}

.task-item {
    background-color: var(--task-item-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.task-item:last-child {
    margin-bottom: 0;
}

#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px;
    background-color: var(--header-color);
    color: var(--bg-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.task-item {
    cursor: pointer;
}

.provenance-info {
    display: none;
    background-color: var(--task-list-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.provenance-info h4 {
    margin-top: 0;
}

.provenance-info ul {
    padding-left: 20px;
}

.input-provenance-item {
    margin-bottom: 15px;
    border-left: 2px solid var(--border-color);
    padding-left: 10px;
}

.nested-object {
    margin-left: 20px;
}

.trace-list {
    background-color: var(--task-list-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 20px;
}

.trace-prefix {
    background-color: var(--task-item-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.trace-prefix h4 {
    cursor: pointer;
    user-select: none;
}

.trace-prefix h4::before {
    content: '▶ ';
    display: inline-block;
    transition: transform 0.3s;
}

.trace-prefix.expanded h4::before {
    transform: rotate(90deg);
}

.table-wrapper {
    display: none;
}

.trace-prefix.expanded .table-wrapper {
    display: block;
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.trace-prefix ul {
    padding-left: 20px;
}

.trace-table {
    width: 100%;
    border-collapse: collapse;
}

.trace-table th,
.trace-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

.trace-table th {
    position: sticky;
    top: 0;
    background-color: var(--header-color);
    color: var(--bg-color);
    z-index: 1;
}

.trace-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.trace-table .status-cell {
    max-width: 300px;
    white-space: normal;
    word-wrap: break-word;
}

.trace-table tr:nth-child(even) {
    background-color: var(--task-list-bg);
}

.trace-table tr:hover {
    background-color: var(--task-item-bg);
}

.trace-table .adding {
    background-color: var(--adding-color);
}

.trace-table .removing {
    background-color: var(--removing-color);
}

.trace-table .zero-count {
    font-weight: bold;
}

.trace-table .notification-row {
    background-color: var(--notification-color);
}

.trace-table .notification-row:hover {
    background-color: var(--notification-hover-color);
}

.table-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, var(--bg-color-alpha-80), transparent);
    pointer-events: none;
}

.notification-counter {
    background-color: var(--notification-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 10px;
}