.diff-controls {
    margin-bottom: 1rem;
}

.diff-controls label {
    margin-right: 1rem;
    cursor: pointer;
}

.diff-inputs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.diff-inputs textarea {
    flex: 1;
    min-height: 150px;
    padding: 0.5rem;
    font-family: monospace;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    resize: vertical;
}

.diff-output {
    padding: 1rem;
    background: var(--border);
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: monospace;
}

#result .diff-line {
    display: flex;
}

#result .line-num {
    min-width: 6ch;
    padding-right: 1ch;
    text-align: right;
    color: #888;
    user-select: none;
    flex-shrink: 0;
}

#result .line-content {
    flex: 1;
}

#result del {
    text-decoration: none;
    background: #fadad7;
    color: #b30000;
}

#result ins {
    text-decoration: none;
    background: #eaf2c2;
    color: #406619;
}

#result .diff-line.removed .line-content::before {
    content: '- ';
    font-weight: bold;
}

#result .diff-line.added .line-content::before {
    content: '+ ';
    font-weight: bold;
}

#result .diff-line.unchanged .line-content {
    padding-left: 2ch;
}

#result .diff-line:empty {
    display: none;
}

@media (prefers-color-scheme: dark) {
    #result del {
        background: #5c1a1a;
        color: #ff9999;
    }

    #result ins {
        background: #1a3d1a;
        color: #99ff99;
    }
}

/* Patch viewer styles */
.section-header {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

#patch {
    overflow-x: auto;
}

#patch .line-add {
    background: #eaf2c2;
    color: #406619;
    display: block;
}

#patch .line-del {
    background: #fadad7;
    color: #b30000;
    display: block;
}

#patch .line-header {
    color: #0066cc;
    font-weight: bold;
    display: block;
}

#patch .line-range {
    color: #6f42c1;
    display: block;
}

#patch .line-context {
    color: var(--text);
    display: block;
}

@media (prefers-color-scheme: dark) {
    #patch .line-add {
        background: #1a3d1a;
        color: #99ff99;
    }

    #patch .line-del {
        background: #5c1a1a;
        color: #ff9999;
    }

    #patch .line-header {
        color: #66b3ff;
    }

    #patch .line-range {
        color: #b388ff;
    }
}
