/* --- Wrapper (Matches Stopwatch/Diff Theme) --- */
#rt-wrapper {
    font-family: 'Press Start 2P', monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    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;
}

/* --- Sections --- */
.rt-section {
    width: 100%;
    background-color: #1f2937;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #374151;
}

.rt-label {
    font-size: 0.7rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    border-bottom: 2px solid #374151;
    padding-bottom: 5px;
}

/* --- Pattern Input --- */
.rt-pattern-box {
    display: flex;
    align-items: center;
    background-color: #111827;
    border: 2px solid #4b5563;
    border-radius: 4px;
    padding: 5px 10px;
    transition: border-color 0.2s;
}

.rt-pattern-box:focus-within {
    border-color: #3b82f6; /* Blue focus */
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.rt-slash {
    color: #6b7280;
    font-size: 1.2rem;
    font-weight: bold;
    user-select: none;
}

.rt-input-pattern {
    flex: 1;
    background: transparent;
    border: none;
    color: #e879f9; /* Pink/Purple for regex */
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 1.1rem;
    padding: 10px;
    outline: none;
    width: 100%;
}

.rt-input-pattern.error {
    color: #ef4444; /* Red on error */
}

.rt-input-flags {
    width: 50px;
    background: transparent;
    border: none;
    color: #10b981; /* Green for flags */
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 1rem;
    padding: 5px;
    outline: none;
    text-align: center;
    cursor: default;
}

/* --- Flags Checkboxes --- */
.rt-flags-container {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.rt-flag {
    font-size: 0.7rem;
    color: #d1d5db;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace, sans-serif; /* Readable font for labels */
}

.rt-flag input {
    cursor: pointer;
}

/* --- Input/Output Grid --- */
.rt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

.rt-col {
    display: flex;
    flex-direction: column;
}

.rt-textarea, .rt-output-box {
    width: 100%;
    background-color: #1f2937;
    border: 1px solid #374151;
    color: #d1d5db;
    font-family: 'Press Start 2P', monospace, sans-serif;
    font-size: 0.9rem;
    padding: 15px;
    border-radius: 6px;
    height: 200px;
    resize: vertical;
    outline: none;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-y: auto;
}

.rt-textarea:focus {
    border-color: #3b82f6;
    color: white;
}

/* Output Specifics */
.rt-output-box {
    background-color: #000;
    border: 4px solid #333;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

/* Custom Scrollbar */
.rt-output-box::-webkit-scrollbar, .rt-textarea::-webkit-scrollbar { width: 8px; }
.rt-output-box::-webkit-scrollbar-track, .rt-textarea::-webkit-scrollbar-track { background: #111; }
.rt-output-box::-webkit-scrollbar-thumb, .rt-textarea::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }

/* --- Highlighting --- */
.rt-match {
    background-color: rgba(59, 130, 246, 0.4); /* Blue Highlight */
    color: #fff;
    border-radius: 2px;
    box-shadow: 0 0 0 1px #3b82f6;
    font-weight: bold;
}

/* --- Status Bar --- */
.rt-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;
}

.rt-status.success {
    color: #10b981;
    border-color: #059669;
}

.rt-status.error {
    color: #ef4444;
    border-color: #b91c1c;
}

/* --- Clear Button --- */
.rt-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;
}

.rt-btn-clear:active {
    transform: translateY(4px);
    border-bottom: none;
    margin-bottom: 4px;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .rt-grid {
        grid-template-columns: 1fr;
    }
    
    .rt-textarea, .rt-output-box {
        height: 150px;
    }
}