/* --- Wrapper (Matches Stopwatch Theme) --- */
#tb-wrapper {
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 900px;
    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 --- */
.tb-grid {
    display: flex;
    width: 100%;
    gap: 15px;
    align-items: stretch;
}

.tb-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Headers --- */
.tb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #374151;
    padding-bottom: 8px;
}

.tb-label {
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tb-mini-btn {
    background: #374151;
    border: none;
    color: #d1d5db;
    font-family: inherit;
    font-size: 0.6rem;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tb-mini-btn:hover {
    background: #4b5563;
    color: white;
}

.tb-mini-btn.active {
    background: #10b981;
    color: #064e3b;
}

/* --- Textareas --- */
.tb-textarea {
    width: 100%;
    height: 300px;
    border-radius: 6px;
    padding: 15px;
    resize: vertical;
    outline: none;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 2px solid #374151;
    background-color: #1f2937;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tb-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.text-mode {
    color: #e2e8f0; /* White/Gray text */
}

.bin-mode {
    color: #10b981; /* Matrix Green */
    background-color: #000; /* Darker bg for code */
    border-color: #333;
}

.bin-mode:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

/* --- Divider Arrow --- */
.tb-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 1.5rem;
    user-select: none;
}

/* --- Status Bar --- */
.tb-status {
    width: 100%;
    text-align: center;
    padding: 10px;
    background-color: #111;
    border: 1px solid #374151;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    color: #6b7280;
    text-transform: uppercase;
}

.tb-status.success {
    color: #10b981;
    border-color: #059669;
}

.tb-status.error {
    color: #ef4444;
    border-color: #b91c1c;
}

/* --- Clear Button --- */
.tb-btn-clear {
    width: 100%;
    background-color: #ef4444;
    color: #7f1d1d;
    border: none;
    border-bottom: 4px solid #b91c1c;
    border-radius: 4px;
    padding: 15px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.1s;
}

.tb-btn-clear:active {
    transform: translateY(4px);
    border-bottom: none;
    margin-bottom: 4px;
}

.tb-btn-clear:hover {
    filter: brightness(1.1);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .tb-grid {
        flex-direction: column;
    }
    
    .tb-divider {
        transform: rotate(90deg);
        margin: 10px 0;
    }

    .tb-textarea {
        height: 150px;
    }
}