.contrast-checker-wrapper .tool-card {
    background: #ffffff;
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    border-top: 4px solid var(--primary) !important;
}

.contrast-checker-wrapper h1 {
    font-size: 2.25rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.checker-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: start;
    margin-top: 1rem;
}

/* Inputs */
.control-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    display: block;
}

.color-picker-wrapper {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 2px solid var(--gray-300);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.color-picker-wrapper input[type="color"] {
    position: absolute;
    top: -10px; left: -10px;
    width: 70px; height: 70px;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hex-input-wrapper {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: all 0.3s ease;
    overflow: hidden;
}

.hex-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.hash-prefix {
    padding: 0.75rem 0.5rem 0.75rem 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-light);
    background: var(--gray-50);
    user-select: none;
    display: flex;
    align-items: center;
}

.hex-input-wrapper input {
    flex-grow: 1;
    min-width: 0; /* FIX: Prevents flexbox horizontal blowout on mobile */
    padding: 0.75rem 1rem 0.75rem 0.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    border: none;
    outline: none;
    background: transparent;
    text-transform: uppercase;
    font-family: 'Inter', monospace;
    letter-spacing: 1px;
}

/* Swap Button */
.btn-swap {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.btn-swap:hover {
    background: var(--gray-50);
    color: var(--primary);
    transform: scale(1.1);
}

/* Action Buttons */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}
.btn-action {
    background: var(--white);
    border: 1px solid var(--gray-300);
    color: var(--text);
}
.btn-action:hover:not(:disabled) {
    background: var(--gray-100);
    border-color: var(--primary);
    color: var(--primary);
}
.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Badges */
.status-badge {
    transition: all 0.3s ease;
}
.status-pass {
    border-color: #10b981;
    color: #10b981;
    background: #ecfdf5;
}
.status-fail {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

.badge-sm {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-pass {
    background: #ecfdf5;
    color: #10b981;
    border: 1px solid #a7f3d0;
}
.badge-fail {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

/* History */
.history-item {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: white;
}
.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.history-item-colors {
    display: flex;
    height: 30px;
}
.history-item-colors div {
    flex: 1;
}
.history-item-ratio {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0;
    color: var(--slate-600);
}

/* Responsive */
@media (max-width: 768px) {
    .checker-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contrast-checker-wrapper .tool-card {
        padding: 1.5rem 1rem; 
    }
}

@media (max-width: 480px) {
    .contrast-checker-wrapper h1 {
        font-size: 1.85rem; 
    }
}