/* --- Wrapper (Matches Stopwatch Theme) --- */
#td-wrapper {
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px; /* Wider for text diff */
    margin: 0 auto;
    background-color: #111827; /* Gray 900 */
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 2px solid #374151; /* Gray 700 */
    color: white;
    gap: 20px;
}

/* --- Grid Layout for Inputs --- */
.td-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.td-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.td-label {
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #374151;
    padding-bottom: 5px;
}

/* --- Textareas --- */
.td-textarea {
    background-color: #1f2937; /* Gray 800 */
    border: 1px solid #374151;
    color: #d1d5db; /* Gray 300 */
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 0.9rem;
    padding: 10px;
    border-radius: 6px;
    height: 200px;
    resize: vertical;
    width: 100%;
    outline: none;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.td-textarea:focus {
    border-color: #3b82f6; /* Blue */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    color: white;
}

/* --- Controls --- */
.td-controls {
    display: flex;
    gap: 15px;
    width: 100%;
}

.td-btn {
    flex: 1;
    padding: 15px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 4px 0 rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.td-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.td-btn.compare {
    background-color: #10b981; /* Green */
    color: #064e3b;
    border-bottom: 4px solid #059669;
}

.td-btn.clear {
    background-color: #ef4444; /* Red */
    color: #7f1d1d;
    border-bottom: 4px solid #b91c1c;
}

/* --- Result Panel --- */
.td-result-panel {
    width: 100%;
    background-color: #000;
    border: 4px solid #333;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
}

.td-output-box {
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 0.95rem;
    color: #9ca3af;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 150px;
    max-height: 400px;
    overflow-y: auto;
}

/* Custom Scrollbar */
.td-output-box::-webkit-scrollbar { width: 8px; }
.td-output-box::-webkit-scrollbar-track { background: #111; }
.td-output-box::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }

/* Diff Highlights */
.td-output-box del {
    background-color: rgba(239, 68, 68, 0.3); /* Red 500 alpha */
    color: #fca5a5;
    text-decoration: none; /* Remove strikethrough for cleaner look, or keep it */
    border-bottom: 2px solid #ef4444;
    padding: 0 2px;
}

.td-output-box ins {
    background-color: rgba(16, 185, 129, 0.3); /* Emerald 500 alpha */
    color: #6ee7b7;
    text-decoration: none;
    border-bottom: 2px solid #10b981;
    padding: 0 2px;
}

/* --- Legend --- */
.td-legend {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    font-size: 0.6rem;
    color: #6b7280;
    margin-top: 5px;
}

.td-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.td-del-legend {
    width: 12px;
    height: 12px;
    background-color: rgba(239, 68, 68, 0.5);
    border: 1px solid #ef4444;
}

.td-ins-legend {
    width: 12px;
    height: 12px;
    background-color: rgba(16, 185, 129, 0.5);
    border: 1px solid #10b981;
}

/* --- Responsive --- */
@media (max-width: 700px) {
    .td-grid {
        grid-template-columns: 1fr;
    }
}